I need to extract at a particular zoom level (17) and resolution (1280x1280) satellite images in GeoTiff (.tif) format that cover my polygons and points in my GeoJson file.
To obtain static images in .png format with Google Maps and Mapbox APIs there is no problem, but how can I get them in .tif format concretely?
The Mapbox and Google Maps APIs do not allow exporting in this format.
For example to export Point data as static images with Mapbox Static Images API, this simple script works very well (using geopandas).
gdf = geopandas.read_file(path_file) for _, row in gdf.iterrows(): image = open(name + ".png", 'wb') # image name is automatically generated image.write(requests.get('https://api.mapbox.com/styles/v1/mapbox/satellite-v9/static/'+ str(row['longitude']) +','+str(row['latitude'])+','+str(zoom)+',0/'+str(width)+'x'+str(height)+'@2x?access_token='+Mapbox_access_token).content) image.close()
Here is the image returned for latitude = 23.093865104007651 and longitude = 39.216685022463729 with the zoom and size quoted above. We can see the point located (like a wheel) in the center of the image.
I would just like to get the same result but have the image in GeoTiff format. Then I can process it, with rasterio for example. As it was advised to me in a previous question I tried with a WMS or WFS as with sentinelsat Python API, but I did not succeed in doing it exactly, especially with my need to have an image with a specific zoom.