geoparquet-lite

Read, write and validate GeoParquet 1.0/1.1 files in Python with only pyarrow (no GDAL or geopandas): WKB and GeoArrow encodings, bbox covering, row-group spatial filtering and a CLI.

Version 0.1.2 · Python >=3.9 · MIT licence
pip install geoparquet-lite
PyPISourceIssuesChangelogCite (DOI)

geoparquet-lite

PyPI version Python versions pipeline status License: MIT DOI Downloads

Read, write and validate GeoParquet 1.0 and 1.1 with nothing but pyarrow.

No geopandas, shapely, GDAL or PROJ is required. That makes it a good fit for data pipelines, serverless functions, DuckDB and Spark interop, and small containers where a full geospatial stack is too heavy. geopandas and shapely remain available as optional extras for interop.

pip install geoparquet-lite                 # pyarrow only
pip install "geoparquet-lite[geopandas]"    # + GeoDataFrame bridges

Features

Quick start

import geoparquet_lite as gpq

fc = {
    "type": "FeatureCollection",
    "features": [
        {"type": "Feature", "geometry": {"type": "Point", "coordinates": [29.0, 41.0]},
         "properties": {"name": "Istanbul"}},
        {"type": "Feature", "geometry": {"type": "Point", "coordinates": [32.85, 39.93]},
         "properties": {"name": "Ankara"}},
    ],
}

# GeoParquet 1.1, WKB, bbox covering column, zstd. Returns the written `geo` metadata.
gpq.write(fc, "cities.parquet", crs="EPSG:4326", sort_hilbert=True, row_group_size=50_000)

# Native GeoArrow encoding instead of WKB:
gpq.write(fc, "cities_native.parquet", encoding="geoarrow")

# Read only what intersects a box. Row groups outside it are never read.
table = gpq.read_table("cities.parquet", bbox=(28, 40, 30, 42), columns=["name", "geometry"])

# Stream batches, or GeoJSON features:
for batch in gpq.iter_batches("cities.parquet", batch_size=10_000):
    ...
for feature in gpq.read_features("cities.parquet", bbox=(28, 40, 30, 42)):
    print(feature["properties"]["name"], feature["geometry"])

report = gpq.validate("cities.parquet")
print(report)            # "cities.parquet: valid GeoParquet (0 error(s), 0 warning(s), ...)"
assert report.ok

print(gpq.info("cities.parquet"))          # rows, row groups, encodings, CRS, row-group bboxes

Converting and upgrading files

gpq.convert("in.parquet", "native.parquet", encoding="geoarrow")   # WKB -> native
gpq.convert("native.parquet", "wkb.parquet", encoding="WKB")       # native -> WKB
gpq.add_bbox_covering("v1_0.parquet", "v1_1.parquet", sort_hilbert=True)

table = gpq.read_table("in.parquet", to_encoding="geoarrow")       # convert while reading
table = gpq.convert_table(table, "WKB")
gpq.write(table, "out.parquet")       # tables keep their CRS / edges / orientation metadata

WKB and GeoArrow helpers

from geoparquet_lite import wkb, geoarrow

blob = wkb.dumps({"type": "Polygon", "coordinates": [[[0, 0], [1, 0], [1, 1], [0, 0]]]})
wkb.loads(blob)                         # -> GeoJSON-like dict
wkb.read_header(blob)                   # WKBHeader(Polygon XY, ISO, little)

# XYM has no GeoJSON form, so a "dims" key marks it:
wkb.dumps({"type": "Point", "coordinates": [1, 2, 7], "dims": "XYM"})

arr = geoarrow.from_geometries([...])           # narrowest native encoding that fits
geoarrow.to_geometries(arr, "polygon")
geoarrow.to_wkb(arr, "polygon"); geoarrow.from_wkb(wkb_array, "multipolygon")

geopandas / shapely (optional)

from geoparquet_lite import interop

gdf = interop.to_geopandas(gpq.read_table("cities.parquet", bbox=(28, 40, 30, 42)))
interop.from_geopandas(gdf, "out.parquet", encoding="geoarrow")
geoms = interop.to_shapely(table.column("geometry"), "WKB")

CLI

geoparquet-lite info data.parquet [--json]
geoparquet-lite validate data.parquet [--metadata-only] [--max-rows N] [--strict] [--json]
geoparquet-lite to-geojson data.parquet [-o out.geojson] [--bbox xmin,ymin,xmax,ymax] [--columns a,b] [--seq]
geoparquet-lite from-geojson in.geojson out.parquet [--encoding WKB|geoarrow|polygon|...]
        [--crs EPSG:4326|unknown|crs.json] [--edges spherical] [--orientation]
        [--geoparquet-version 1.0.0|1.1.0] [--no-bbox] [--sort] [--row-group-size N]
geoparquet-lite add-bbox in.parquet out.parquet [--name bbox] [--sort]
geoparquet-lite convert in.parquet out.parquet --encoding geoarrow

validate exits with status 1 when the file has errors, or with --strict when it has warnings. Any other failure exits with status 2. from-geojson also reads newline-delimited GeoJSON and RFC 8142 text sequences, and reads stdin when the input is -.

Spec coverage

GeoParquet feature 1.0 1.1 Notes
version, primary_column, columns yes yes written as 1.1.0 by default; version="1.0.0" is available
encoding: WKB yes yes ISO WKB, little-endian on write; EWKB is accepted on read and flagged by validate
native encodings (point ... multipolygon) n/a yes separated layout, XY/XYZ/XYM/XYZM; single and multi variants merge into the multi encoding
geometry_types yes yes computed on write; checked per row (WKB) or per column (native)
crs (PROJJSON, absent = OGC:CRS84, null = unknown) yes yes checks required PROJJSON members per CRS type
edges, orientation, epoch, bbox yes yes orientation="counterclockwise" rewinds rings on write and is checked by validate
covering.bbox n/a yes struct of xmin/ymin/xmax/ymax doubles; used for row-group pruning and verified per row

validate() also checks the following:

How the validator compares with the official JSON schemas. It gives the same verdict as the official schema.json for v1.0.0 and v1.1.0 (with the PROJJSON v0.7 schema) on 106 metadata objects. Those objects come from files written by this package, geopandas 1.2, GDAL 3.13 and DuckDB 2.0. It is stricter in two places:

The official schema files are not bundled.

Interoperability (tested)

Limitations

Development

git clone https://gitlab.com/geophilo1/geoparquet_lite_sdk.git
cd geoparquet_lite_sdk
pip install -e ".[dev,geopandas]"
pytest --cov=geoparquet_lite
ruff check . && ruff format --check src tests && mypy src

The GDAL interop tests run when ogrinfo is on PATH, or when GEOPARQUET_LITE_OGRINFO points to it. The DuckDB tests run when duckdb is installed.

Data credits

The bundled PROJJSON definitions in geoparquet_lite/data/projjson.json were exported with PROJ from the EPSG Geodetic Parameter Dataset (https://epsg.org), © IOGP, and from the OGC CRS84 definition.

Related Geophilo SDKs

License

MIT © Yusuf Eminoğlu. See LICENSE.

Academic citation

@software{eminoglu_geoparquet_lite,
  author  = {Eminoğlu, Yusuf},
  title   = {geoparquet-lite},
  year    = {2026},
  version = {0.1.2},
  doi     = {10.5281/zenodo.24065108},
  url     = {https://doi.org/10.5281/zenodo.24065108}
}

See also CITATION.cff.

Other Geophilo SDKs