I'm building a tool that downloads images from "Sentinel-2 on AWS"
I have a trouble translating Long/Lat coordinates to a specific Sentinel tile. I know that Sentinel 2 uses MGRS and I tried to simply convert Long/Lat to MGRS and with low precision I get the S2A tile ID. And it works, but not always.
For example, Long/Lat 34.665,31.625 resolves to "36R XA" in MGRS, but the Sentinel tile 36RXA doesn't exist.
What would be the right way of determining Sentinel tile using Long/Lat coordinates?
Best Answer
Such a tool already exists. It is called Sentinelsat and the source is available on GitHub. It offers a command line interface and a Python API. It works with Sentinel 1 and 2. The spatial query is based on a polygon and not a point, but otherwise this is exactly what you need.
EDIT: 1) you can return the product ID (or product ID list) using the query function. And from the command line, you can omit the -d option in order not to launch the download (and use the -f option to create the footprint of each image) 2) Concerning the geojson, you can see below that a wkt could be used directly instead. As mentionned by @ThingumaBob, you can create a tiny polygon based on your lat/long coordinates. But in fact, I've tested it with a point GeoJason and it also worked fine. So there is no need to convert your point into polygon.
which could be adjusted into