I would like to create a feature collection consisting of the centroid points of the pixels in an image. The question of how to do this has been asked before on Stack Exchange, but not actually answered.

For example, suppose we have a single image such as the ESA 2009 global land cover. I crop this to the boder of the Republic of Congo:

var countries = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017');
var congo = countries.filter(ee.Filter.eq('country_na', 'Rep of the Congo'));

var dataset = ee.Image('ESA/GLOBCOVER_L4_200901_200912_V2_3').clip(congo);

With this data, how do I obtain a collection of points at the centroid of each pixel in the image? Converting the image to a feature collection does not seem to be the right approach, as this assigns polygons based on properties (not pixels).


As it turns out, someone has answered this question before on Stack Exchange. See this link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.