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

get the coordinates of a user-drawn polygon #34

Closed
andrebelem opened this issue Jun 13, 2021 · 8 comments
Closed

get the coordinates of a user-drawn polygon #34

andrebelem opened this issue Jun 13, 2021 · 8 comments
Labels
Feature Request New feature or request

Comments

@andrebelem
Copy link

First of all, congratulations Dr. Qiusheng for your fantastic work !

I became a 100% geemap user and one of the very useful functions when working with feature exploration (1) is to manually draw a polygon in an area of interest, (2) extract the coordinates with Map.draw_last_feature and then (3) export this polygon as a shapefile or even a featureCollection in the case of ee.

I looked for something similar in the leafmap but I couldn't find it, although it is possible to easily draw the polygon and see its individual points, but it seems to me that there is a lack of a similar routine to manipulate the coordinates extracted from the map.

That would be of great value.
Best wishes
Andre

@andrebelem andrebelem added the Feature Request New feature or request label Jun 13, 2021
@giswqs
Copy link
Member

giswqs commented Jun 13, 2021

You can use Map.user_roi and Map.user_rois to return the last drawn shape and all drawn shapes, respectively. See #2

@giswqs giswqs closed this as completed Jun 13, 2021
@andrebelem
Copy link
Author

andrebelem commented Jun 13, 2021 via email

@andrebelem
Copy link
Author

andrebelem commented Jun 13, 2021 via email

@giswqs
Copy link
Member

giswqs commented Jun 13, 2021

Are you using Colab? It is for ipyleaflet only.

@andrebelem
Copy link
Author

andrebelem commented Jun 13, 2021 via email

@giswqs
Copy link
Member

giswqs commented Jun 13, 2021

Try binder https://gishub.org/leafmap-pangeo

@andrebelem
Copy link
Author

andrebelem commented Jun 13, 2021 via email

@giswqs
Copy link
Member

giswqs commented Jun 13, 2021

In Colab, you can use the following line to add an export button to the map, but you can't use m.user_roi or m.user_rois. See https://leafmap.org/faq/#why-does-leafmap-use-two-plotting-backends-folium-and-ipyleaflet

m = leafmap.Map(draw_export=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants