Returns a Reducer that computes the (weighted) sum of its inputs.
Returns a Reducer that computes the number of non-null inputs.
reduceRegion(reducer, geometry, scale, crs, crsTransform, bestEffort, maxPixels, tileScale)
Apply a reducer to all the pixels in a specific region.
Either the reducer must have the same number of inputs as the input image has bands, or it must have a single input and will be repeated for each band.
Returns a dictionary of the reducer's outputs.
The image to reduce.
The reducer to apply.
geometry (Geometry, default: null):
The region over which to reduce data. Defaults to the footprint of the image's first band.
scale (Float, default: null):
A nominal scale in meters of the projection to work in.
crs (Projection, default: null):
The projection to work in. If unspecified, the projection of the image's first band is used. If specified in addition to scale, rescaled to the specified scale.
crsTransform (List, default: null):
The list of CRS transform values. This is a row-major ordering of the 3x2 transform matrix. This option is mutually exclusive with 'scale', and replaces any transform already set on the projection.
bestEffort (Boolean, default: false):
If the polygon would contain too many pixels at the given scale, compute and use a larger scale which would allow the operation to succeed.
maxPixels (Long, default: 10000000):
The maximum number of pixels to reduce.
tileScale (Float, default: 1):
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.