0

I have a large amount of data stored on a postgreSQL database (RDS) with the PostGIS extension enabled. We are currently doing quality assessment of the data and therefore I would like to inspect/share results with my colleagues overseas. I find querying the database and parsing the result to pandas and geopandas in a Jupyter Notebook (Google Colab) extremely helpful. Connecting to the database using ArcMap or QGIS is less ideal since we need a lot of charting functionality (time series).

The approach I took so far is to add popup functionality and style to a geodataframe using folium. results for a sample dataset can be found here

A caveat is that this method does not scale very well and fails on my dataset due to the number of geometries. Data and visualization happens client-side and the method fails with complex geometries are large geodataframes. I am looking into alternatives with the following requirements:

  • interactive (zoom,pan)
  • popup (tooltip) with attribute (property) values
  • color / style
  • handle 16000 geometries, large number of vertices (200MB)
  • ideally server-side or serverless design.
  • ideally open source.

So far I've looked into

  1. cartoframes: does exactly what I want except that tooltips are not supported yet.

Other packages that I will look into: 1. Arcgis API for python. 2. Mapbox API for python. 3. mapboxgl-jupyter

1

I've got a PR in for some more advanced Tooltipping in folium right now. It's functional right now but trying to add in some best practice with how the template is rendered and where it is stored - to be able to use the same Tooltip class across multiple folium objects. The Tooltips render client side in a JS function bound to the GeoJSON object - meaning you don't have to break each feature out of the GeoDataFrame to display the underlying data on the map. Might be helpful for your use case - feel free to clone my patch-2 branch if it looks like it might help.

https://github.com/python-visualization/folium/pull/883

My nbviewer use case seems like it might be analogous to yours, but not sure how well it will scale with the size of your dataset. Before I simplified the geometries in there, it was a pretty large HTML file as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.