TransWikia.com

Filter Image Collection by Multiple WRS Path/Rows using Google Earth Engine JavaScript API

Geographic Information Systems Asked by Dex on May 29, 2021

How can I filter an image collection in Google Earth Engine by multiple WRS paths/rows?

This is an example of a filter using one path.row:

var sr2011 = ee.ImageCollection('LANDSAT/LT5_SR')
  .filterDate('2011-06-20', '2011-08-31')
  .filter(ee.Filter.eq('WRS_PATH', 59))
  .filter(ee.Filter.eq('WRS_ROW', 18));

2 Answers

Try combining AND and OR filters or, if more complicated, you could look into ee.Filter.inList:

var sr2011 = ee.ImageCollection('LANDSAT/LT5_SR')
  .filterDate('2011-06-20', '2011-08-31')
  .filter(ee.Filter.or(
    ee.Filter.and(ee.Filter.eq('WRS_PATH', 59),         
                  ee.Filter.eq('WRS_ROW', 18)),
    ee.Filter.and(ee.Filter.eq('WRS_PATH', 60), 
                  ee.Filter.eq('WRS_ROW', 19))))

This works but capitals are needed on ee.Filter.Or and ee.Filter.On

Correct answer by Matifou on May 29, 2021

Answered by Dante on May 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP