nsidc / earthaccess

Python Library for NASA Earthdata APIs
https://earthaccess.readthedocs.io/
MIT License
409 stars 81 forks source link

Search data by tile/list of tiles [Feature request] #487

Open Rapsodia86 opened 7 months ago

Rapsodia86 commented 7 months ago

Hello again! I was wondering if there would be an option to search for data using a tile/tiles aside from a bounding box? That option exists in the https://search.earthdata.nasa.gov/search

A few combinations: 1) download MOD21A2.061 h11v04 #it is easy to find coordinates for one tile 2) download MOD21A2.061 h11-12v04-05 #need a bounding box that overlaps those four tiles 3) download MOD21A2.061 h11v04 & h12v05 #would do the search and download twice?

The same case is for VIIRS or HLS which uses MGRS, or any other tile-based dataset. Now I can filter my search results using e.g., #409, but if the tiles are not adjacent, I have to do a big spatial search in the first step.

Thanks!

betolink commented 7 months ago

I think this is doable, and useful! maybe we can prototype this in one of the upcoming hack days.

EDIT: looks like there is a bug in the CMR API that prevents us from using this parameter, they are working on a fix but I don't have an ETA.

betolink commented 7 months ago

@Rapsodia86 has this search criteria worked for you in the past, from the portal?

Rapsodia86 commented 7 months ago

At the end of this January, I reported a portal error about filtering granules based on Military Grid Reference System by sending email to the support. And got something like this:

"Hi Monika,
Thanks very much for the details steps. I've written an internal ticket to investigate and resolve this as I don't see a way to filter the granules based on the MGRS tile ids. If we find a better workaround that's available to Earthdata Search Client we'll be back in touch with you.
I don't know if it suits your needs or not, but you can use the CMR Search API directly, specifying the MGRS tile id as an Additional Attribute (assuming the metadata supports this in all cases). Example, the following query (using the curl client) returns granules in the C2021957295-LPCLOUD collection ("HLS Sentinel-2 Multi-spectral Instrument Surface Reflectance Daily Global 30m v2.0") for the "30PUU" tile.

curl -i "[https://cmr.earthdata.nasa.gov/search/granules.umm_json?collection_concept_id=C2021957295-LPCLOUD&attribute\[\]=string,MGRS_TILE_ID,30PUU&pretty=true](https://cmr.earthdata.nasa.gov/search/granules.umm_json?collection_concept_id=C2021957295-LPCLOUD&attribute\%5b\%5d=string,MGRS_TILE_ID,30PUU&pretty=true)"
"

After your question @betolink, I went to the portal. Before (those two months back), MGRS was on a "Tiling System" list for the granules filtering. Now there are only "None" & "MODIS Tile SIN". But it does not work at all! I suspect they might have turned this off totally.

I would be happy to help with this when the issue in the CMR API is fixed!