Draw and export landmarks¶
Draw landmarks on the map, export them as vector data, and load edits back into the widget.
Goal¶
Move landmarks between milume and GeoPandas (or any tool that reads GeoJSON/Shapefile via GeoDataFrame).
Steps¶
- Open milume on spatial data (ileum demo):
-
Draw or edit landmarks in the browser (Landmarks). Each edit updates
w.landmarks. -
Convert the synced list to a GeoDataFrame (
geopandasrequired):
import geopandas as gpd
from milume import landmarks_to_geodataframe, geodataframe_to_landmarks
gdf = landmarks_to_geodataframe(w.landmarks)
gdf.to_file("landmarks.geojson", driver="GeoJSON")
- Edit
gdfoffline, then push it back:
- Run measure helpers against the same
adataand exported geometry when you need distances or composition (Measure API).
Result¶
landmarks.geojson (or your chosen path) matches what you drew; assigning back to w.landmarks updates the map.
Column semantics and CRS notes are in GeoDataFrame interchange.