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

Timeless.
  • 644
  • 4
  • 13
  • 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 Jul 29 '22 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. Jul 29 '22 at 13:44
  • Yes. pyproj, geopandas, gdal/ogr. https://gis.stackexchange.com/a/78944/2856 – user2856 Jul 29 '22 at 23:22

1 Answers1

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

Pierrick Rambaud
  • 2,788
  • 1
  • 14
  • 49