1

the console gives me a view into the 'properties' of the ImageCollection object:

ImageCollection LANDSAT/LC08/C01/T1_SR (107 elements)
type: ImageCollection
id: LANDSAT/LC08/C01/T1_SR
version: 1524816484446982
bands: []
features: List (107 elements)
properties: Object (23 properties)

and the docs describe methods to access the properties of the properties object.

problem: how do I read the features list? I want the 'id' property of each of the images (which the console can show me). I have tried:

var imageList = myImageCollection.toList(100).features;

and the error is: Cannot read property '0' of undefined

hoping for an undocumented method, I tried:

var imageList = myImageCollection.features();

and the error is: myImageCollection.features is not a function

3

You can access the ID of an image using ee.Image.id(). For example:

var geometry = ee.Geometry.Point([-112.62, 40.98]);

var myImageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
  .filterBounds(geometry);

// Create a list of image objects.
var imageList = myImageCollection.toList(100);
print('imageList', imageList);

// Extract the ID of each image object.
var id_list = imageList.map(function(item) {
  return ee.Image(item).id();
});
print('id_list', id_list);
  • thank you, Tyler. (as one of the ee training audience members said, maybe this is an opportunity for more API sugar?) – user1405141 May 2 '18 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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