Feature #9534
GeoJson store: systematically use geodataframes
100%
Description
Currently, there's a mix of:
- (for category/survey models): get data from DB with Geopandas and process using vectorised pandas/numpy operations
- (for custom defined models): get data from DB using gino
-> change all models to allow feature retrieving through GeoPandas.
Benefits:
- unified process
- expected bug speedups when Geopandas, Shapely and PyGeos get integrated, which will provide vectorized operations on geometries (see https://github.com/Toblerity/Shapely/issues/782 and related tickets, eg. https://github.com/pygeos/pygeos/issues/82)
Biggest refactorings:
- popup: implement get_popup_from_df
and deprecate caption
, get_popup
- properties: implement get_properties_from_df
and deprecate get_properties
- styles (mapbox-layout
and mapbox-paint
): currently, they are added to GeoJson FeatureCollection
object, which might not follow the standard: move to HTTP headers
Related issues
Associated revisions
Refs #9534: generalize GeoDataframes
Use gdf.to_json() (slightly faster, gygeos should bring an order of magnitude speed improvement
Implement:
- model.get_geojson_http_headers
- model.get_popup_from_df
- model.model.get_popup_from_df
- mapbox-paint and mapbox-layout move HTTP headers
Refs #9534: geodataframe for geojson generation
Implement:
- get_popup_from_df
- get_properties_from_df
Exception: Well
Refs #9534: Well: use dataframe for geojson
Refs #9534: cadastral: use dataframe for geojson
Refs #9534: Refactoring, cleanups
Refs #9534: Refactoring, cleanups
Refs #9534: update live layers
Mapbox style given in HTTP headers
Use redis stores for mapbox_paint and mapbox_layout
Fix performance goofup
Refs #9534: fix well get_properties
Refs #9534: fix cadastral location text on map
Refs #9534: fix waste water treatment plant style
Refs #9534: cleanup: use nice pandas string ops
instead of dirty numpy
History
#1 Updated by Philippe May almost 5 years ago
TODO: fix:
- CadastralLocation text
- wells
- optical fiber style
- geological formation style
#2 Updated by Philippe May almost 5 years ago
- % Done changed from 0 to 100
- Status changed from New to Resolved
#3 Updated by Philippe May almost 5 years ago
- Related to Support #9483: Performance: writing gpkg is slower than shapefiles added