maskCoverRegion#

geetools.ImageAccessor.maskCoverRegion(region, scale=None, band=None, proxyValue=-999, **kwargs)#

Compute the coverage of masked pixels inside a Geometry.

Parameters:
  • region (ee.Geometry) – The region to compute the mask coverage.

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

  • band (Optional[str | ee.String]) – The band to use. Defaults to the first band.

  • proxyValue (int | ee.Number) – the value to use for counting the mask and avoid confusing 0s to masked values. In most cases the user should not change this value, but in case of conflicts, choose a value that is out of the range of the image values.

  • **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 percentage of masked pixels within the region.

Return type:

ee.Number

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)