11

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?

  • 1
    Intersect with the Sentinel-2 tiling grid? – user2856 Feb 10 '17 at 5:21
  • Yeah, I saw this KML. That would be my last resort since lookups are expensive. I hope I can do it with calculation – GetUsername Feb 10 '17 at 6:13
  • 3
    Check out github.com/sat-utils/sentinel2-util – bugmenot123 Feb 10 '17 at 9:15
  • You can do this in Google Cloud as they have all the meta data in BigQuery, eg, SELECT * FROM [bigquery-public-data:cloud_storage_geo_index.sentinel_2_index] where north_lat < 50 and north_lat > 49 order by sensing_time LIMIT 10, but you mention AWS, so I guess this won't help. – John Powell Sep 7 '17 at 15:15
4

S2 partitioning in MGRS is tricky specially when the data is between UTM zones and the tiles overlap, see the figure below. Tiles from left to right are 20_M_QE, 20_M_RE, 21_M_SV and 21_M_TV:

A search made through opensearch for the region returns one S2 acquisition broken in two tiles, 20_M_RE and 21_M_TV:

20_M_RE

enter image description here

So if you are interested in data in the represented 21_M_SV tile region you should use 20_M_RE. Note that the representation used in the examples (shapefile obtained from NGA) the overlap between tiles is not represented.

The safest way to obtain the tiles seems to be search your AOI using opensearch and then retrieving the returned tiles, or using the sentinel2-util tool as mentioned by bugmenot123.

If you choose to map the Long/Lat to tiles I recommend using the KML provided by ESA as the tiling grid definition:

https://sentinel.esa.int/web/sentinel/missions/sentinel-2/data-products

4
+200

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.

# search by polygon, time, and Hub query keywords
footprint = geojson_to_wkt(read_geojson('map.geojson'))
products = api.query(footprint,
                     date = ('20151219', date(2015, 12, 29)),
                     platformname = 'Sentinel-2',
                     cloudcoverpercentage = (0, 30))

which could be adjusted into

# search by point, time, and Hub query keywords

products = api.query('POINT({0} {1})'.format(longitude,latitude),
                     date = ('20151219', date(2015, 12, 29)),
                     platformname = 'Sentinel-2',
                     cloudcoverpercentage = (0, 30))
  • thanks @radouxju, I am aware of Sentinelsat, but my specific need is to get the tile name for a corresponding lat/lon. I do not know if Sentinelsat does that – user1186 Feb 8 at 18:45
  • @user1186 produce a tiny bbox around the lat/lon to feed the API? seems silly but could be all you need... – ThingumaBob Feb 9 at 12:18
  • @ThingumaBob, I could do that but the API will return NDVI values. I only want the tile ID, if there is a way to do that through the API, I would love to know – user1186 Feb 9 at 18:26

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.