pyo3-geoarrow
PyO3 bindings for GeoArrow types, enabling seamless integration between Rust's GeoArrow implementation and Python.
This crate provides Python-compatible wrappers around GeoArrow data structures, allowing Python code to efficiently work with and share geospatial data in the GeoArrow format through the Arrow C Data Interface (using the Arrow PyCapsule Interface) without data copies.
Features
- Zero-copy data exchange: Use Arrow's C Data Interface for efficient memory sharing between Rust and Python.
- GeoArrow types: Python bindings for GeoArrow geometry arrays, scalars, and metadata.
- Type safety: Strongly-typed wrappers that preserve GeoArrow's type system in Python.
- FFI support: Import and export GeoArrow data to/from Python using the Arrow PyCapsule Interface.
Core Types
- [
PyGeoArray]: Python wrapper for GeoArrow geometry arrays - [
PyGeoChunkedArray]: Python wrapper for chunked GeoArrow geometry arrays - [
PyGeoArrayReader]: Python wrapper for streaming array readers - [
PyGeoScalar]: Python wrapper for GeoArrow scalar geometries - [
PyGeoType]: Python wrapper for GeoArrow data types - [
PyCrs]: Python wrapper for coordinate reference system representation
Usage
This crate is primarily intended for use by Python binding developers who need to interoperate with GeoArrow data in Python. It is also used internally by the geoarrow-rust-* Python packages.
use Arc;
use *;
use PyGeoArray;
use GeoArrowArray;
Integration with Arrow
This crate implements the Arrow PyCapsule Interface, allowing GeoArrow objects to be exchanged with any Python library that supports Arrow, including:
- PyArrow
- Polars (once they support extension types)
- GeoPandas (via PyArrow)
- DuckDB
Dependencies
This crate builds on:
pyo3: Python bindings for Rustpyo3-arrow: Arrow integration for PyO3geoarrow-array: Core GeoArrow array typesgeoarrow-schema: GeoArrow type system and metadata