ee.Image.sampleRegions

Samples the pixels of an image in one or more regions, returning them as a FeatureCollection. Each output feature will have 1 property per band in the input image, as well as any specified properties copied from the input feature. Note that geometries will be snapped to pixel centers.

UsageReturns
Image.sampleRegions(collection, properties, scale, projection, tileScale, geometries)FeatureCollection
ArgumentTypeDetails
this: imageImage

The image to sample.

collectionFeatureCollection

The regions to sample over.

propertiesList, default: null

The list of properties to copy from each input feature. Defaults to all non-system properties.

scaleFloat, default: null

A nominal scale in meters of the projection to sample in. If unspecified,the scale of the image's first band is used.

projectionProjection, default: null

The projection in which to sample. If unspecified, the projection of the image's first band is used. If specified in addition to scale, rescaled to the specified scale.

tileScaleFloat, default: 1

A scaling factor used to reduce aggregation tile size; using a larger tileScale (e.g. 2 or 4) may enable computations that run out of memory with the default.

geometriesBoolean, default: false

If true, the results will include a geometry per sampled pixel. Otherwise, geometries will be omitted (saving memory).

Examples

JavaScript

// Your example goes here!

Python

# Your example goes here!