Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search PEPS S2 products by tile id #255

Closed
floriandeboissieu opened this issue Apr 21, 2021 · 6 comments · Fixed by #713
Closed

Search PEPS S2 products by tile id #255

floriandeboissieu opened this issue Apr 21, 2021 · 6 comments · Fixed by #713
Labels
documentation Improvements or additions to documentation
Projects

Comments

@floriandeboissieu
Copy link

Most people I know are downloading PEPS images by tile id (e.g. for experiments on S2 L1C->L2A processing)
There is an example on how to do that in https://eodag.readthedocs.io/en/stable/tutorials/tuto_search_area.html#Custom-locations-configuration:-download-products-from-a-Sentinel-2-tile.
It may be useful for a regex search like "31T[CDE][MLK]", but it seems pretty complex to get only one tile, e.g. "31TFK".

Would it be possible to integrate an example such as the following somewhere in the documentation/tutorials?

products = dag.search_all(
    productType='S2_MSI_L1C',
    start='2018-06-01',
    end='2018-12-01',
    tileid="31TFK"
)
@sbrunato
Copy link
Collaborator

sbrunato commented Apr 21, 2021

Hello @floriandeboissieu , maybe you missed cell [41], just above the quoted example:
image

We may try to make it stand out more, to make users see it at first, before the more complex example.

Anyway, does this example seem ok on your side ?

@floriandeboissieu
Copy link
Author

floriandeboissieu commented Apr 21, 2021

Hi @sbrunato,
If I understood well s2_tile_centroid is a column of a shape file you built for the example and containing the centroids of the tiles. Thus, according to that example, if I wanted to download images by tile name, I would have first to (tell me if I am wrong):

  1. download the S2 tile grid
  2. compute the tile centroids
  3. save these centroids in a vector file
  4. reference the vector file as the location file

It can be done, but it looks pretty complex to me in regard of the simple use of the PEPS keyword tileid in the search request :-).

@maximlt
Copy link
Collaborator

maximlt commented Apr 21, 2021

You're right @floriandeboissieu.

You could skip the first three steps by downloading the Shapefile we use in the example from the repo.

Yet, it is still not as straightforward as what you suggest.

@sbrunato I see that PEPS accepts a tileid query string, e.g. https://peps.cnes.fr/resto/api/collections/S2ST/search.json?startDate=2021-01-01T03:12:10.267Z&completionDate=2021-02-01T03:12:10.267Z&tileid=31TCJ&productType=S2MSI1C&maxRecords=5&page=1

Could we add it as one of the query-able parameters?

@floriandeboissieu
Copy link
Author

floriandeboissieu commented Apr 21, 2021

Just to be sure that we understand each other, tileid is already query-able just like cloudCover, because any parameter member of kwargs is either processed (if known) or directly forwarded to search_kwargs with which is build the query url, if I understood well the code. Thus the first example above works well. It would only need to appear in the documentation in my opinion.

@maximlt
Copy link
Collaborator

maximlt commented Apr 22, 2021

Yes you got it right, tileid is unknown to eodag but still propagated through the query mechanism and included in the query URL.

We just opened #242 that highlights the issue of EODAG's internal catalog not being easy to access. We were thinking about automatically generating a nice HTML page to have a quick overview of what products are available. We could add in this page, for each product type, which extra search parameters (beyond start, end and geometry) EODAG knows about. These extra parameters are currently difficult to find. Prior to that, we would need to:

  • Add tileid as a query-able parameter for PEPS (in the returned JSON, the corresponding property seems to be '$.properties.mgrs')
  • Do the same thing for the other providers that offer the same or similar query parameter

@sbrunato
Copy link
Collaborator

@floriandeboissieu @maximlt tileid is a peps S2_MSI_L1C and S2_MSI_L2A specific parameter. It is not documented for the moment because it is very specific and also not included in OpenSearch for EO.

As for others provider specific parameters, you can use it as custom query parameter in eodag. It will be included in the request to the provider:

prods, _ = dag.search(tileid="31TFK", foo="bar", **other_args)

When working on #242 we can look for similar parameters on other providers and include it in providers configuration and documentation

@sbrunato sbrunato added documentation Improvements or additions to documentation priority::1 labels Apr 22, 2021
@sbrunato sbrunato added this to Low Priority in eodag.* Apr 22, 2021
eodag.* automation moved this from priority::1 to Done Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
No open projects
eodag.*
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants