Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select and edit vector data in ipyleaflet #599

Closed
AlexanderJuestel opened this issue May 17, 2020 · 5 comments
Closed

Select and edit vector data in ipyleaflet #599

AlexanderJuestel opened this issue May 17, 2020 · 5 comments

Comments

@AlexanderJuestel
Copy link

AlexanderJuestel commented May 17, 2020

Dear community,

For the implicit open source geomodeling package GemPy (https://github.com/cgre-aachen/gempy) we are looking for a way to easily and interactively manipulate vector data/esri shape files (loading, plotting reprojection is no issue).

We as Geologists mainly work with point data (e.g. orientation measurements of layers), line data (e.g. fault traces where indices have to be extracted) or polygons (e.g. geological maps where vertices of certain layer boundaries are needed). All of this is input data for our modeling package. In general, the modeling package only reads in point data and computes a model based on that.

However, as we are visual people, we would like to visualize our (surface) data where we would like to use ipyleaflet for. In addition, we would like to perform very simple manipulations such as adding single points or removing points right away in python/Jupyter Notebooks instead of in a GIS software such as QGIS or ArcGIS.

Is this feature available in ipyleaflet somehow (e.g. With DrawControl) or does anyone know or can recommend any packeges (such as leaflet-geoman or geemap @giswqs) that can perform these basic tasks without leaving the ipyleaflet map environment?

Thanks for your help :)
Alex

@giswqs
Copy link
Contributor

giswqs commented May 17, 2020

You can convert shapefiles to geojson, then you should be able to load the geojson to ipyleaflet and manipulate markers. Here are some relevant functions and examples:

You can also try out geemap if you want to utilize the computational power of Earth Engine. Check out my tutorials:

  • 5 Using drawing tools to interact with Earth Engine data
  • 6 Creating an interactive map with a marker cluster

@AlexanderJuestel
Copy link
Author

Thanks for the quick response @giswqs!

I will test it out and close the issue afterwards :)

@giswqs
Copy link
Contributor

giswqs commented Jan 14, 2022

I just discovered that the ipyleaflet DrawControl has a data attribute. Basically, you can read a list features from a GeoJSON and assign it to the data attribute of the DrawControl. Then you can use the editing tool to edit shapes. Modifying attributes interactively might be possible as well, but it needs more work. I will see if I can implement it in leafmap next week.
opengeos/leafmap#179

draw_control

@giswqs
Copy link
Contributor

giswqs commented Jan 14, 2022

By integrating ipysheet, it seems possible to edit vector data attributes interactively.

@giswqs
Copy link
Contributor

giswqs commented Jan 30, 2022

Thanks to the data attribute of the ipyleaflet DrawControl, leafmap now supports loading, creating, editing, and saving vector data interactively without coding.

46_edit_vector.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants