opengeos / leafmap

A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment
https://leafmap.org
MIT License
3.23k stars 389 forks source link

`edit_polygons` unable to transform CRS correctly #932

Closed patel-zeel closed 1 month ago

patel-zeel commented 1 month ago

Environment Information

Description

This issue is similar to #920. edit_polygons does not work if gdf is not in EPSG:4326.

What I Did

show_what_fails = True

import leafmap.leafmap as leafmap
import geopandas as gpd

m = leafmap.Map()
m.add_basemap("HYBRID")

gdf = gpd.read_file("https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/countries.geojson")
if show_what_fails:
    gdf = gdf.to_crs("EPSG:3857")
else:
    gdf = gdf.to_crs("EPSG:4326")
m.edit_polygons(gdf)
m