0

I am working in GEE and I am trying to extract areas of clusters for some specific coordinates.

I have a clustered map of the area of all the clusters (using object-based clustering) and a list of coordinates. I am trying to extract areas of those clusters only whose coordinates are available. The coordinates can lie anywhere in the cluster but that cluster's whole area should be extracted.

I have tried this approach but it isn't giving me the area of the whole cluster. What I am getting are the values like: 11.8, 8.7, etc. But the actual values are in 100's.

area_map = ee.Image.pixelArea().divide(1e6).addBands(clusters).reduceConnectedComponents(ee.Reducer.sum(), "clusters", 256) #Per-cluster area calculation
coordinates_features = ee.FeatureCollection(coordinates.tolist())
area_list = area_map.reduceRegions(collection= coordinates_features, reducer= ee.Reducer.first().setOutputs(['area']), scale=30)
print('area', area_list)

Can someone please guide, how do we achieve this?

th145
  • 11
  • 2

0 Answers0