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

Interactive vector maps for Jupyter Notebooks #1710

Merged
merged 31 commits into from
Jul 19, 2021

Conversation

chaedri
Copy link
Contributor

@chaedri chaedri commented Jul 5, 2021

  • InteractiveMap class produces interactive folium maps centered on current g.region in Jupyter Notebooks
  • Functions for adding vectors to folium map by
  • Vectors are passed from GRASS to folium by reprojecting to WGS84 in a temporary Location, exporting as GeoJSON files and importing to folium.

This PR contains functions for displaying GRASS vector data in interactive folium maps for Jupyter Notebooks. It is part of an ongoing Google Summer of Code project, Improved Integration of GRASS and Jupyter Notebooks. You can find more information here.

@chaedri

This comment has been minimized.

@chaedri chaedri changed the title Interactive display for Jupyter Notebooks for Vectors Interactive vector maps for Jupyter Notebooks Jul 5, 2021
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, I agree with the general idea, so here are just some details, initial thoughts and questions.

python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
@veroandreo

This comment has been minimized.

@chaedri

This comment has been minimized.

python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
@wenzeslaus wenzeslaus added this to In progress in Integration with Jupyter Notebooks via automation Jul 6, 2021
@wenzeslaus wenzeslaus added enhancement New feature or request gsoc Reserved for Google Summer of Code student(s) labels Jul 6, 2021
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
@wenzeslaus
Copy link
Member

03f2dd6 seems to revert changes from the previous commit. git restore -s e8e97b4 -- interact_display.py would get you the old version if this was a mistake. If you have some changes you care about - it seems there are some - running black interact_display.py is a better option as long as you check that 03f2dd6 did not remove any of the changes from e8e97b4 you care about.

@chaedri
Copy link
Contributor Author

chaedri commented Jul 8, 2021

@wenzeslaus Oops! Thanks for catching that. I've been working developing/testing in a Jupyter Notebook then copying and pasting into interact_display.py. So, I accidentally removed all the formatting I did.

python/grass/jupyter/Makefile Outdated Show resolved Hide resolved
python/grass/jupyter/setup.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
@chaedri chaedri marked this pull request as ready for review July 12, 2021 15:27
@veroandreo
Copy link
Contributor

I get the following error in the notebook when reaching the interactive part:

ValueError: Cannot render objects with any missing geometries: PosixPath('tmp/tmp_boundary_region.json')

python/grass/jupyter/Makefile Outdated Show resolved Hide resolved
doc/notebooks/jupyter_integration.ipynb Show resolved Hide resolved
doc/notebooks/jupyter_integration.ipynb Outdated Show resolved Hide resolved
python/grass/jupyter/interact_display.py Outdated Show resolved Hide resolved
@chaedri chaedri marked this pull request as draft July 12, 2021 21:29
@chaedri
Copy link
Contributor Author

chaedri commented Jul 12, 2021

I get the following error in the notebook when reaching the interactive part:

ValueError: Cannot render objects with any missing geometries: PosixPath('tmp/tmp_boundary_region.json')

Oops - I have fixed this now and changed the way that I test/commit code. Now, it's easier for me to test before committing so hopefully, I will push fewer errors in the future.

@chaedri chaedri marked this pull request as ready for review July 13, 2021 14:14
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge assuming we will get back to some of the issues such as temporary files and documentation.

@chaedri Please update the main PR description so that it reflects latest state and contains what was implemented, intention, decisions made (brief summary), and whatever might be relevant to future us, other maintainers, or feature announcements, see e.g., 86acc1c and 78feee7. I will use the text for the commit message when merging.

@wenzeslaus wenzeslaus merged commit 3e3a881 into OSGeo:master Jul 19, 2021
Integration with Jupyter Notebooks automation moved this from In progress to Done Jul 19, 2021
@chaedri chaedri deleted the interactive-vectors branch July 20, 2021 13:44
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
…Notebooks (OSGeo#1710)

* InteractiveMap class produces interactive folium maps zoomed to the current computational region in Jupyter Notebooks.
* Vectors are passed from GRASS to folium by reprojecting to WGS84 in a temporary Location, exporting as GeoJSON files and importing to folium.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
…Notebooks (OSGeo#1710)

* InteractiveMap class produces interactive folium maps zoomed to the current computational region in Jupyter Notebooks.
* Vectors are passed from GRASS to folium by reprojecting to WGS84 in a temporary Location, exporting as GeoJSON files and importing to folium.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s)
Development

Successfully merging this pull request may close these issues.

None yet

4 participants