Does anyone know if GEE sampleRegions()
includes pixels that are on the edge of the polygon? I want to train a classifier with polygons, and want the classifier only to look at pixels that are completely inside by the polygon, ie not pixels that are touching the polygon perimeter.
For example, in this image, are pixels that are bisected by the polygon perimeter included in the call to sampleRegions
?
Here is an excerpt from the GEE guide, second code block on this page, that shows using the sampleRegions
function in context of a simple supervised classification.
// Get the values for all pixels in each polygon in the training.
var training = image.sampleRegions({
// Get the sample from the polygons FeatureCollection.
collection: polygons,
// Keep this list of properties from the polygons.
properties: ['class'],
// Set the scale to get Landsat pixels in the polygons.
scale: 30
});
I didn't see anything in the API docs about this.