Changes between Version 17 and Version 18 of GSoC/2021/JupyterAndGRASS/MiniGrant2022


Ignore:
Timestamp:
04/22/22 09:35:46 (3 years ago)
Author:
chaedri
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GSoC/2021/JupyterAndGRASS/MiniGrant2022

    v17 v18  
    22
    33= GRASS GIS Mini Project 2022: Space-Time Dataset Visualization and Improved Interactive Maps for grass.jupyter=
     4
     5For more information about `grass.jupyter` and to learn more about the current API, please visit the [https://grass.osgeo.org/grass81/manuals/libpython/grass.jupyter.html manual page].
    46
    57|| Title: || '''Space-Time Dataset Visualization and Improved Interactive Maps for grass.jupyter'' ||
     
    122124}}}
    123125{{{#!td
    124 
    125 }}}
    126 {{{#!td
    127 
     126Write tests for !TimeSeries and GRASS-folium objects
     127}}}
     128{{{#!td
     129Ok
    128130}}}
    129131|-----------------------
     
    133135}}}
    134136{{{#!td
    135 
    136 }}}
    137 {{{#!td
    138 
     137Write test for !ReprojectionRenderer \\
     138Merge existing pull requests for GRASS-folium and !TimeSeriesMap
     139}}}
     140{{{#!td
     141Ok \\
     142Ok
    139143}}}
    140144|-----------------------
     
    144148}}}
    145149{{{#!td
    146 
    147 }}}
    148 {{{#!td
    149 
     150Implement changes to grass.jupyter class names\\
     151Write final report
     152}}}
     153{{{#!td
     154Ok \\
     155Ok
    150156}}}
    151157
     
    269275== Week 8 ==
    270276
     277This is my last update before the final report! I'm finally wrapping up work on the grass.jupyter mini grant. We're just putting the final changes in the two PRs that I've been working on for a while ([https://github.com/OSGeo/grass/pull/2010 here] and [https://github.com/OSGeo/grass/pull/2208 here]) and getting ready to implement the grass.jupyter naming conventions before the release of 8.2 ([https://github.com/OSGeo/grass/issues/2283 GitHub Issue]). Here's a quick summary:
     278
     279**1) What have I accomplished since my last update?**
     280* I continue to have regular meetings with Vashek Petras. This week, we talked about testing and some minor edits for the existing pull requests ([https://github.com/OSGeo/grass/pull/2010 here] and [https://github.com/OSGeo/grass/pull/2208 here])
     281* Wrote tests for ReprojectionRenderer - a class that handles reprojecting vector and raster data for folium ([https://github.com/OSGeo/grass/pull/2208 PR])
     282* Had some productive discussions about naming conventions for grass.jupyter ([https://github.com/OSGeo/grass/issues/2283 GitHub Issue])
     283
     284**2) What do I plan to do next week?**
     285* Merge existing pull requests ([https://github.com/OSGeo/grass/pull/2010 here] and [https://github.com/OSGeo/grass/pull/2208 here])
     286* Implement changes to grass.jupyter class names ([https://github.com/OSGeo/grass/issues/2283 GitHub Issue])
     287* Write final report
     288
     289**3) Am I blocked on anything?**
     290* No
     291
     292Feedback, thoughts and comments welcome!
    271293
    272294== Final Report ==
    273 **Title:** Title\\
    274 
    275 **Abstract:**\\
    276 
    277 
    278 **The state of integration BEFORE the start of Mini Grant:**\\
    279 
    280 
    281 **The state of integration AFTER Mini Grant:**\\
    282 
    283 
    284 **Conclusion:**\\
    285 
    286 
    287 **Future Work:**\\
    288 
     295
     296**Title:** Space-Time Dataset Visualization and Improved Interactive Maps for `grass.jupyter`
     297
     298Last week, we wrapped a final push on `grass.jupyter` and are excited for its official release with GRASS 8.2. Here's my final report along with a summary of `grass.jupyter` changes introduced as part of the project. Thank you all for your support, feedback and testing over the past few months!
     299
     300**The state of the art BEFORE the start of the Mini Project:**
     301
     302During GSoC 2021, we created `grass.jupyter`, a package that improves the integration of GRASS GIS and Jupyter with a set of functions for displaying GRASS data in Jupyter Notebooks. In its previous state, `grass.jupyter` allows users to create static visuals and simple interactive maps. However, several additional features are needed to allow Jupyter users to fully and easily access the power GRASS, including space-time dataset visualization and more options for interactive mapping.
     303
     304**Project Goals:**
     305
     306In preparation for the stable release of `grass.jupyter` with GRASS 8.2, this project had three main goals: (1) create space time dataset visualizations for use in Jupyter Notebooks, (2) improve the integration of GRASS with folium (leaflet library for Python) and (3) write a function for displaying vector attributes in nicely-formatted tables (using Pandas or !GeoPandas). Along the way, we also wanted to finalize the naming of `grass.jupyter` classes and create documentation (thank you Vaclav Petras).
     307
     308**The state of the art AFTER the Mini Project:**
     3091. New !TimeSeriesMap class that creates ipywidget time sliders of space time datasets (see attached timeseriesmap.png) and [https://mybinder.org/v2/gh/OSGeo/grass/main?urlpath=lab%2Ftree%2Fdoc%2Fnotebooks%2Ftemporal.ipynb a notebook] documenting it's usage
     3102. Improved GRASS-folium integration allowing rasters and vectors to be added to existing folium maps (see attached grass-folium.png) and an updated [https://mybinder.org/v2/gh/OSGeo/grass/main?urlpath=lab%2Ftree%2Fdoc%2Fnotebooks%2Fgrass_jupyter.ipynb notebook] demonstrating its usage
     3113. Updated class names:
     312* !GrassRenderer -> Map
     313* !Grass3dRenderer -> Map3D
     314* !InteractiveMap
     315* !TimeSeries -> !TimeSeriesMap
     3164. Thanks to Vaclav Petras, we also have [https://grass.osgeo.org/grass81/manuals/libpython/grass.jupyter.html a manual page] for `grass.jupyter`
     3175. I didn't end up working to integrate GRASS and Pandas. It seems that it is quite straightforward to display vector attributes in nicely-formatted Pandas tables. For example:
     318{{{
     319#!div style="font-size: 80%"
     320  {{{#!python
     321  import json
     322  import pandas as pd
     323  pd.DataFrame(json.loads(gs.read_command("v.db.select", map="viewpoints", columns="cat,height", layer=2, format="json"))["records"])
     324  }}}
     325}}}
     326There are other outputs that would be nice to display in nice Pandas tables, like text output from r.univar, r.stats, or t.vect.list. However, this is difficult since there is no standard output that is easily parse-able to pandas. I think the best way would be to create a standard json or csv output for all modules that return text. Then, it would be simple to take any module output and convert to a nice-looking Pandas table.
     327
     328**Next Steps:**
     3291. Bug: !InteractiveMap does not honor `use_region=True` for vectors.
     3302. Bug: !InteractiveMap for Jupyter does not handle not existing data properly ([https://github.com/OSGeo/grass/issues/2302 GitHub Issue])
     3313. !InteractiveMap: add legend options for rasters, support !simpleCRS for faster rendering, !ToolTip integration for vector attributes
     3324. Continue Pandas integration by adding standard json or csv output to modules that return text
     3335. ... And many others! I think there's still lots of ways we can improve and expand the integration of GRASS and Jupyter. Ideas welcome.
     334
     335You can follow next steps for grass.jupyter on our project page on [https://github.com/OSGeo/grass/projects/7 GitHub]. Thank you again to Vaclav Petras and Anna Petrasova for their guidance and contributions to grass.jupyter. And, another thank you to Vero Andreo, Stefan Blumentrath and Markus Neteler for their feedback and testing!
     336
     337[[Image(timeseriesmap.PNG, 600px, align=left)]]
     338[[Image(grass-folium.PNG, 600px, align=center)]]