epifanio / grass-cesium

Additional option in grass mapdisplay to render rich html+js webpage. The aim is to include cesium js and jupyter notebook as external tools to visualize and interact with the GRASS GIS database.
4 stars 0 forks source link

TBD #1

Open epifanio opened 8 years ago

epifanio commented 8 years ago

This code is a patched version of the original GRASS WxGUI code to add:

  1. a new option in the drop-down menu for the GRASS map-display which is then connected to a rich HTML page which supports js (requires wxpython 3.x+) [intended to contain a CesiumJS widget]
  2. a new tab in the GRASS layer manager with a rich HTML page [intended to point to jupyer-notebook istance]
epifanio commented 8 years ago

I studied some of the issues involved in having cesium integrated with GRASS .. the problem is complex and I'm not a js/python guro ... but AFAIK to have a bi-directional communication between javascript and grass-python (grass.script, pygrass, ...) IMHO the best (easiest) solution is to have an ipython (or jupyer, they are equivalent) kernel running and bind the grass environment to the ipython kernel. At this point will be possible to create an ipython-dashboard-template based on the ipython-widget (simple jquery objects like buttons, slider, dropdown menu connected to python functions) which will control the ipython-cesiumwidget. The alternative, more complex is to build our own tornado app which will bind js and python .. but this goes far away from my little knowledge.

After a grass-cesium connection is made using the ipython kernel, we are left with the terrain problem .. on how to render terrain in cesium from the grass data. One solution to this can be the adoption of the cesium terrain builder and the cesium terrain provider. Having this tool installed will allow us to run a "stager function" which will take as input the terrain data from GRASS, convert to cesium tiles and server them as url.

Of course this will involve the addition of a number of extra dependencies and IMHO its value is very remarcable if there is any intention from the GRASS devs to think of a GRASS web User Interface, not just embedding an HTML widget into the actual wxgui.

(i'll come back to this notes ASAP, adding more info and link to libraries and examples)

epifanio commented 7 years ago

I'm switching (very slowly) to PyQt5. however, in WX WebView.RunScript can be used to run js code into the webview page. This code can be easly connected to zoom to, add layer, mouse over ... functionalities.