I am displaying an image to Leaflet. The image is a result of a process from a backend I am also building. I cannot get the right bounds for the image. I return the bounds from the function gdal.Info.

from osgeo import gdal
src_ds = gdal.Open('./data/example_image.png')
info = gdal.Info(src_ds)

The image has a EPSG:4326 projection and I understand that Leaflet default is EPSG:3857. My question would be, should I reproject my Leaflet app to EPSG:4326? or am I receiving the wrong bounds from GDAL?

If I need to reproject my leaflet app to EPSG:4326, how is it done in react-leaflet?

  • All layers on Leaflet map must be in the same CRS , so if you want to use EPSG:4326, all layers must be in this CRS. To use it, just specify map option crs: L.CRS.EPSG4326.
    – TomazicM
    Mar 5 at 9:33
  • Hi @TomazicM, where do you import that? Should it be a parameter in the MapContainer component in react-leaflet?
    – Nikko
    Mar 5 at 9:42
  • I'm not familiar with React, so can't help you here.
    – TomazicM
    Mar 5 at 10:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.