I'm trying to download sentinel satellite images directly using python. the idea is to use sentinelsat API and a geojson polygon to download it. however it downloads the entire image and not only the polygone. is there a way to make it download only the polygon or to automatically crop the wanted area? thank you in advance
Asked
Active
Viewed 406 times
0
-
What did you read in the documentation of the sentinelsat API about whether it supports specifying a polygon? – mkrieger1 Jul 21 '22 at 09:42
-
They did not specify – Ayoub BENCHAREF Jul 21 '22 at 09:43
-
Doesn't that answer your question then? It's not possible. – mkrieger1 Jul 21 '22 at 09:44
-
I'm asking to see if there is a solution I am unaware of – Ayoub BENCHAREF Jul 21 '22 at 10:54
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jul 21 '22 at 16:59
1 Answers
0
There are a few ways you can go about it, but, based on the documentation, sentinelsat doesn't support such an operation. The easier would be to use gdal and a geojson or shapefile. The way how you can do that is answered here.
The much more complicated way, which also gives you immensely more control on what data you can download is with the Sentinel-2 AWS S3 Buckets and the GDAL python api. Specifically, GDAL has a driver called S3 that allows you to load a raster into memory without downloading it locally. Then, you can use the ReadAsArray function to load specific parts of the image. You can look these bits up from the GDAL docs.

Nikos
- 198
- 1
- 9