vibespatial.io.postgis_gpu¶
GPU-accelerated PostGIS read/write via ADBC (Arrow Database Connectivity).
- Pipeline:
- read: ADBC → Arrow table → split WKB column → GPU decode → NativeTabularResult
→ GeoDataFrame
write: OwnedGeometryArray → GPU WKB encode → Arrow table → ADBC bulk ingest
ADBC is an OPTIONAL dependency. All public functions return None when
ADBC is not installed, allowing the caller to fall back to the existing
Shapely-based path transparently.
Functions¶
|
Read a PostGIS query into a native tabular result using ADBC + GPU WKB decode. |
|
Read a PostGIS query into a GeoDataFrame using ADBC + GPU WKB decode. |
|
Write a GeoDataFrame to PostGIS using ADBC bulk ingest + GPU WKB encode. |
Module Contents¶
- vibespatial.io.postgis_gpu.read_postgis_native(sql: str, con: str | object, geom_col: str = 'geom', crs: str | int | None = None, chunksize: int | None = None) vibespatial.api._native_results.NativeTabularResult | None¶
Read a PostGIS query into a native tabular result using ADBC + GPU WKB decode.
Parameters¶
- sqlstr
SQL query or table name.
- constr or SQLAlchemy engine/connection
PostgreSQL connection URI (
postgresql://...) or a SQLAlchemy connectable whose.urlcan be extracted.- geom_colstr
Name of the geometry column in the query result.
- crsstr, int, or None
CRS to assign. If
None, attempts auto-detection from PostGIS metadata (simple table queries only).- chunksizeint or None
Not yet supported for the GPU path. If set, returns
Noneso the caller falls back to the Shapely chunked reader.
Returns¶
- NativeTabularResult or None
Nonewhen ADBC is unavailable or any error occurs (caller should fall through to the Shapely-based path).
- vibespatial.io.postgis_gpu.read_postgis_gpu(sql: str, con: str | object, geom_col: str = 'geom', crs: str | int | None = None, chunksize: int | None = None) vibespatial.api.GeoDataFrame | None¶
Read a PostGIS query into a GeoDataFrame using ADBC + GPU WKB decode.
- vibespatial.io.postgis_gpu.to_postgis_gpu(gdf: vibespatial.api.GeoDataFrame | vibespatial.api._native_results.NativeTabularResult, name: str, con: str | object, if_exists: str = 'fail', schema: str | None = None, index: bool = False) bool¶
Write a GeoDataFrame to PostGIS using ADBC bulk ingest + GPU WKB encode.
Parameters¶
- gdfGeoDataFrame
The data to write.
- namestr
Target table name.
- constr or SQLAlchemy engine/connection
PostgreSQL connection URI or a SQLAlchemy connectable.
- if_existsstr
"fail","replace", or"append".- schemastr or None
Database schema. Defaults to
"public".- indexbool
Whether to write the DataFrame index as a column.
Returns¶
- bool
Trueif the write succeeded via ADBC;Falseif the caller should fall back to the Shapely/GeoAlchemy2 path.