[GIS] Get image names from image collection in Google Earth Engine

google-earth-engine

This seems very basic, but I cannot figure out how to extract the image names from an image collection in Google Earth Engine. I can get a count of the number of images, but not the names. Here is an example.

var ROI = ee.Geometry.Rectangle(-82.5574, 35.5958, -82.5563, 35.59515); // define area

var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
    .filterDate('2014-05-01', '2015-10-01')
    .filterBounds(ROI);

Now I want to do something like collection.ImageNames().

Best Answer

Every image in your image-collection has many properties (i.e. metadata). You can see a list of these properties by calling:

print(collection.first().propertyNames());

I guess the image names you are looking for is specified by the property 'LANDSAT_PRODUCT_ID', so by calling:

print(collection.aggregate_array('LANDSAT_PRODUCT_ID'));

you can get a list of names in you current collection.

Related Question