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)

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.

enter image description here

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.

  • 1
    WMS or WCS would be standard driven solutions, for delivery of GeoTIFF.
    – nmtoken
    Commented Jan 7, 2021 at 9:31
  • What data source are you interested in? What type of data do you want to download? What resolution? Why does it have to be .tif?
    – Erik
    Commented Jan 7, 2021 at 9:33
  • 1
    I would like to extract the satellite image in .tif corresponding to this location from where?
    – nmtoken
    Commented Jan 7, 2021 at 9:38
  • Data source like images from satellites sentinel 1 and 2, with 1280x1280 resolution for example. As if I was extracting static images that covered my points and polygons but in .tif format not in .jpg or .png format.
    – Tim
    Commented Jan 7, 2021 at 9:55
  • See gis.stackexchange.com/questions/372425/… for how you might do this manually, you would need a bounding box though not a point.
    – nmtoken
    Commented Jan 7, 2021 at 11:23


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.