geoparquet-io¶
Fast I/O and transformation tools for GeoParquet files, powered by DuckDB and PyArrow.
- One interface for conversion, sorting, partitioning, and spatial indexing.
- CLI and Python API with full type hints.
- Unix pipes with Arrow IPC streamingโno intermediate files.
- Read/write to S3, GCS, Azure, HTTPS via DuckDB and obstore.
- Automatic Hilbert sorting, ZSTD compression, bbox columns.
- Add H3, S2, A5, quadkey, KD-tree spatial indices.
- Aggregate huge datasets into A5/H3 grid cells or admin regions for low-zoom visualization.
- GeoParquet 1.1 and 2.0 support, including Parquet geometry types.
Installation¶
uv tool install geoparquet-io # CLI (recommended)
uv add geoparquet-io # Python library
Or with pip:
pip install geoparquet-io
Or with conda (also works with mamba or pixi):
conda install -c conda-forge geoparquet-io
Note: the conda-forge feedstock doesn't yet carry gpio's DuckDB pin (
<1.6, see #1346), so a plain install pulls DuckDB 2.0 and breaksadd s2/partition s2/a5. Pin it:conda install -c conda-forge geoparquet-io 'python-duckdb<1.6'
Quickstart¶
# Convert any vector format to optimized GeoParquet (ZSTD, bbox, Hilbert order)
gpio convert places.geojson places.parquet
# Converting places.geojson...
# Done in 0.5s
# Output: places.parquet (63.45 KB)
# โ Output passes GeoParquet validation (metadata checks)
# Inspect the file
gpio inspect summary places.parquet
# ๐ places.parquet (63.45 KB)
# Rows: 766 | Row Groups: 1 | Compression: ZSTD
# GeoParquet Version: 1.1.0 | CRS: OGC:CRS84 (default)
# Geometry Types: Point
# Bbox: [-0.989102, 9.798559, 1.480825, 12.391399]
# Re-sort and upgrade to GeoParquet 2.0, with native per-row-group bbox stats
gpio sort hilbert places.parquet sorted.parquet --geoparquet-version 2.0
# Check it against best practices
gpio check all sorted.parquet
# โ Version 2.0.0
# โ Uses native Parquet GEOMETRY/GEOGRAPHY types
# โ Bbox covering column 'bbox' declared (optional in 2.0; enables page-level pruning)
# โ Row group statistics available for spatial filtering
# โ ZSTD compression on geometry column 'geom'
# โ Data appears to be spatially ordered
# Spec Validation: โ 40 checks passed
The same flow in Python, in-memory and without intermediate files:
import geoparquet_io as gpio
table = gpio.convert('places.geojson').add_bbox().sort_hilbert()
table.write('sorted.parquet', geoparquet_version='2.0')
result = gpio.check_all('sorted.parquet')
result.passed() # True
Documentation¶
Full documentation is available on the website.
Head to Getting Started to dig in.
Development¶
git clone https://github.com/geoparquet/geoparquet-io.git
cd geoparquet-io
uv sync --all-extras
uv run pytest
See Contributing Guide for details.