1

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

2 Answers 2

5

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.

2
//image collection
var landsat8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')

print(landsat8.aggregate_array('LANDSAT_ID'));

Argument 'LANDSAT_ID' come from description of image properties.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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