I try to extract the centroid of an ee.Image, as follows:
ee.Initialize()
image = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318')\
.geometry()\
.centroid()\
.getInfo()
# {'coordinates': [-122.14451407746256, 37.47160285059076], 'type': 'Point'} #Ok!
However, when I apply the same idea in the next example, I get:
ee.Initialize()
collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')\
.filter(ee.Filter.eq('WRS_PATH', 44))\
.filter(ee.Filter.eq('WRS_ROW', 34))\
.filterDate('2014-01-01', '2015-01-01')\
.sort('CLOUD_COVER')
image = collection.median()
image.geometry().getInfo()
#{'coordinates': [[[-180.0, -90.0], [180.0, -90.0], [180.0, 90.0], [-180.0, 90.0], [-180.0, -90.0]]], 'type': 'Polygon'} #Bad
I was expecting to get the bounding for the WRS_PATH and WRS_PATH specified, not the world bounding. Does someone have an idea to achieve this?