1

I want to display a point/place (somewhere in Hamilton/Bermuda) with Folium but all I get is a blank map in Jupyter-lab:

import folium

map = folium.Map(location = [-64.778389, 32.289978], tiles = "OpenStreetMap", crs='EPSG4216')

map

enter image description here

Is there any explanation for that ? Did I miss something ? Here is the link of that position in epsg : https://epsg.io/map#srs=4216&x=-64.778389&y=32.289978&z=17&layer=streets

enter image description here

3
  • I think the projection/crs is not understood so the map fails to load. It loads fine if you pass it coordinates in EPSG4283.
    – user2856
    Commented Jul 29, 2022 at 13:34
  • Thank you. So, since Folium seems to not recognize these XY coordinates, is there a way we can transform that to Lat/Lon coordinates (in 4326 for e.g) ?
    – Timeless.
    Commented Jul 29, 2022 at 13:44
  • Yes. pyproj, geopandas, gdal/ogr. gis.stackexchange.com/a/78944/2856
    – user2856
    Commented Jul 29, 2022 at 23:22

1 Answer 1

0

AS mentioned in the comment you can simply project your coordinates to 4326 before setting them in the map. Using pyproj the solution could look like:

import folium
from pyproj import Transformer

t = Transformer.from_crs(4216, 4326)

x, y =  32.289978, -64.778389

map = folium.Map(location = t.transform(x, y), tiles = "OpenStreetMap")

map

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.