[FEATURE] Integrate with geopandas
for Native Geospatial Data Handling
#530
Labels
enhancement
New feature or request
Goal
Add built-in support for reading, transforming, and displaying geospatial data via the
geopandas
library, making it easier to build map-based dashboards and spatial analytics apps with Preswald.📌 Motivation
Preswald users are increasingly working with geospatial datasets—such as shapefiles, GeoJSON, and spatial CSVs—but currently must manually transform and flatten geometry fields before displaying them.
By natively integrating with
geopandas
, Preswald can:geo()
component or Plotly maps✅ Acceptance Criteria
geopandas
as a supported backend dependency (pip install geopandas
)geopandas.read_file()
when:type = "geojson"
ortype = "shapefile"
inpreswald.toml
.geojson
,.shp
,.gpkg
GeoDataFrame
to a regular DataFrame with flattenedgeometry
(WKT or GeoJSON format)flatten_geometry = true|false
toggle in data configget_df()
and downstream components (table()
,plotly()
, etc.)geopandas
is missing or file path is invalid🛠 Implementation Plan
1. Update Data Loader in
data.py
Detect
.geojson
,.shp
,.gpkg
, ortype = "geojson"
inpreswald.toml
.2. Example
preswald.toml
🧪 Testing Plan
.geojson
and.shp
filesconnect()
andget_df()
return valid DataFrametable(df)
andplotly()
to inspect spatial columnsflatten_geometry
📚 Docs To Update
docs/configuration.mdx
→ Addtype = "geojson"
/shapefile
+flatten_geometry
docs/sdk/geo.mdx
(future) → Add examples usinggeometry
columngeopandas
via extras:🧩 Related Files
preswald/engine/managers/data.py
preswald.toml
examples/earthquakes.geojson
🔮 Future Enhancements
.to_crs()
)where geometry intersects...
)geo()
map-rendering componentThe text was updated successfully, but these errors were encountered: