maskCover#

geetools.ee_image.ImageAccessor.maskCover(scale=None, proxyValue=-999, propertyName='mask_cover', **kwargs)#

Compute the percentage of masked pixels inside the image.

It will use the geometry and the first band of the image.

Parameters:
  • scale (Optional[int]) – The scale of the computation. In case you need a rough estimation use a higher scale than the original from the image.

  • proxyValue (int) – the value to use for counting the mask and avoid confusing 0s to masked values. Choose a value that is out of the range of the image values.

  • propertyName (str) – the name of the property where the value will be saved

  • **kwargs

    • maxPixels: The maximum number of pixels to reduce.

    • tileScale: A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g., 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default.

Returns:

The same image with the percentage of masked pixels as a property.

Return type:

ee.Image

Examples

import ee, geetools

ee.Initialize()

image = ee.Image('COPERNICUS/S2_SR/20190828T151811_20190828T151809_T18GYT')
aoi = ee.Geometry.Point([11.880190936531116, 42.0159494554553]).buffer(2000)
image = image.geetools.maskCoverRegion(aoi)