TransWikia.com

Get image pixel centroids in Google Earth Engine

Geographic Information Systems Asked on April 14, 2021

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).

One Answer

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

Answered by C. Ashley on April 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP