sedonadb-geopandas
A GeoPandas-compatible API on top of SedonaDB.
The goal is to let existing GeoPandas code run against SedonaDB's relational
engine with minimal changes, by providing GeoDataFrame / GeoSeries wrappers
whose methods mirror GeoPandas but delegate to SedonaDB expressions.
import geopandas
import sedonadb_geopandas as sgpd
gdf = sgpd.from_geopandas(geopandas.read_file("cities.geojson"))
big = gdf[gdf["pop"] > 1_000_000] # boolean-mask filter
gdf["density"] = gdf["pop"] / gdf["area"] # assign a computed column
buffered = gdf.geometry.buffer(0.5) # element-wise .geo operation
web = gdf.to_crs("EPSG:3857") # reproject (CRS tracked through)
zones = gdf.dissolve(by="region") # group and union geometry
result = zones.to_geopandas() # back to a real GeoDataFrame
Intentional differences from GeoPandas
This is a compatibility layer over a lazy, relational engine, so it is deliberately not identical to GeoPandas:
- Lazy, not eager: operations build a query; data materializes on
to_geopandas()/to_pandas()/ display. - No row index / alignment: there is no pandas
Index; joins and filters are positional/relational, not index-aligned. Consequentlydissolve()leaves the group keys as ordinary columns instead of moving them into the index. - Immutable under the hood: "in-place" style operations return a new frame.
A
Seriesread from a frame stays usable across assignments that only add columns (sog = gdf.geometrycan supplyg.area,g.length, ... in turn), but replacing a column or filtering rebinds the frame, and aSeriesread before that is stale and raises rather than silently resolving to different values. - Columns cannot be mixed across frames: without row alignment, combining columns from two different frames raises rather than guessing. Join first.
- Plotting and arbitrary
apply: use theto_geopandas()escape hatch and operate on the materialized result. - Assignment takes a column or a scalar, not a bare expression: a SedonaDB
expression records no origin, so one built from another frame would resolve
against the destination and silently write the wrong values. Assign a
Seriesread from the same frame, or a scalar (a geometry included). For anything the wrapper does not cover, drop to the SedonaDBDataFrameAPI directly.
Division follows pandas rather than SQL: / is true division, so integer
columns do not silently truncate. // is not implemented, since SQL division
truncates toward zero where Python floors. Duration arithmetic whose result
overflows the 64-bit tick range raises when the result is computed, as in
pandas 3 (pandas 2 silently wraps integer overflow, and pandas clamps finite
positive float overflow to Timedelta.max; this layer raises for both). An
integer operand that itself exceeds the 64-bit range raises OverflowError
immediately, as in every pandas version. Mixed-unit duration
operands are rebuilt in the column's own unit when exactly representable,
rather than widening to the engine's interval type.
dissolve() aggregates non-geometry columns with "first", which is an
unordered aggregate: it returns some value from the group rather than the one
from the first row, and unlike GeoPandas it does not skip missing values, so a
group containing a null or NaN may aggregate to that. Dissolving an empty frame
without a group key returns one row — empty geometry collection, null attribute
values — rather than zero rows, because that is what a grouping-free SQL
aggregate produces, and a group mixing 2D and 3D geometries raises rather than
being promoted to 3D. Grouping is observed-only: unused categories of a
categorical key do not produce empty groups the way GeoPandas' default
observed=False does, because the category domain does not survive a relational
aggregation.
See the SedonaDB "Migrating from GeoPandas" guide for the relational model that underlies each method.
Metadata
Release files for sedonadb-geopandas 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sedonadb_geopandas-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / sedonadb_geopandas-0.5.0-py3-none-any.whl
| Download URL | sedonadb_geopandas-0.5.0-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff6253c60a68775641b3b542762abdcdbdf78ee979dcfd72bfc65c7a99b0816f
|
|
BLAKE2b-256 checksum How to use checksums |
0b92d8d13fbb12cb5def4f7400687dc86ac923fe9521e92f96888ec9ff482a42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|