Skip to content

Desktop GUI

Owen Smith edited this page Jun 23, 2021 · 2 revisions

Brainstorm and ideas for desktop application

Several ways to create a map canvas each with pros and cons

Folium with WX WebView

Downloads small html with folium map api. Can use WX's WebView to visualize the map, efficiently stream tiles. However the user would need to be connected to the internet.

Folium does provide a drawing api folium.plugins.draw in addition to GeoJson export. This is nice, however it will be tricky to properly read the events, and if we create WX widgets which are designed to read and react to json calls then it could be difficult to make the gui modular enough to be used in other WX frameworks like GRASS.

Folium layout

Example layout for folium based gui.

Screenshot from 2021-06-23 13-44-17

Problems arise however with Folium serving solely as a visualization library and not a bidirectional processing library between leaflet JavaScript and Python. So in order to be able to get the coordinates from the drawn geometries, additional JavaScript functions would need to be written and then Python functions to turn the results into Python objects.

Another option would be to use the export functionality to write the geometry as a GeoJson to disk. This could easily be turned into a python object and would allow for multiple geometries and geometry types to be used in a single query so long as an efficient parser for geojson -> projpicker strings is used.

Custom map frame widget

Would allow for user maptiles / features to be loaded. Potential higher install size, but dont believe that will be too big of an issue.

Could use GRASS provinces or countries geometries from Basic global dataset. Countries would have lower number of verticies (faster), provinces would have more but imagine would still be optimized.

Bootstrap implementation of GRASS Map canvas

Not even sure if possible, but could be neat.