Better integration with Lonboard for interactive vector data viz?
Proposed new feature or change:
I was messing around with lonboard today and it seems like it provides a fairly easy way to do some more performant interactive vector data viz.
I imagine there are ways to speed this up further if we could avoid some of the conversions. I don't know enough about Uxarray or GeoParquet / GeoArrow to know how much of a lift it would be to anything here though.
This is a quick example to visualize an unstructured grid:
from lonboard import viz
import uxarray as ux
grid = ux.open_grid("~/Downloads/grid.nc")
gdf = grid.to_geodataframe().to_geopandas() # needs a geopandas.GeoDataFrame rather than a spatialpandas object
viz(gdf)
I couldn't get the conversion to a geopandas.GeoDataFrame to finish on my laptop for the 3.75km MPAS grid, but the 30km one completed and the visualization performance was great.
Hi @kafitzgerald
This tool looks really promising! The long execution time for going from spatialpandas to geopandas can probably be avoided if we add support for directly converting a UxDataArray to a geopandas.GeoDataFrame.
Do you have a screenshot of the resulting plot? I'll be giving this a look through soon.
I think it might just be the conversion to the Spatialpandas GeoDataFrame that's taking the bulk of the time (I see a warning about this from UxArray in both the case where I plot with Bokeh and with Lonboard). And timing for converting from a UxDataArray to Spatialpandas object was similar to UxDataArray to Spatialpandas to GeoPandas. I can grab those if that's helpful.
And here's a quick screenshot after zooming in just a bit so we can see the 30km grid (w/ all default options):
No rush to look into this or do anything on my end. I mostly just wanted to share in case it was of interest.
There was some interest in this at the Pangeo Community Meeting today so I may take another look at this.
I suspect the CRS warning has probably been resolved now with some of the changes to UXarray, but it looks like support for geopandas.geoDataFrame is still an open issue (https://github.com/UXARRAY/uxarray/issues/625).