0

How do I filter Landsat imageCollection by their time of collection?

For example, if they are daytime or nighttime, which might be specified as Ascending or Descending.

I don't know which metadata keyword to use for filtering out by that.

  • 1
    Is that what you need or is just an example? The property that holds the exact time is system:time_start, but depending in what you need you may need to process it – Rodrigo E. Principe Nov 10 '18 at 21:28
  • 1
    That is exactly what I was looking for – Anamika Nov 13 '18 at 17:52
1

The property that holds the exact time is system:time_start

For example, to get the latest available image in some collection:

// some collection
var s2 = ee.ImageCollection('COPERNICUS/S2')
// some place    
var p = ee.Geometry.Point(-72, -43)
// filter the collection by the place
s2 = s2.filterBounds(p)
// sort descending by time
var descending = s2.sort('system:time_start', false)
// get latest image (first of the collection)
var latest = ee.Image(descending.first())

print(latest.date())

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.