geobuf
Geobuf is a compact binary geospatial format for lossless compression of GeoJSON.
What it is and what it does
Geobuf is a binary serialization format for GeoJSON that trades JSON's human readability for dramatic file-size reduction. It encodes geographic feature collections into a compact protobuf-based format, typically shrinking files by 6-8x compared to raw GeoJSON, and 2-2.5x compared to gzipped JSON. The format is lossless—all properties, coordinates, and geometries survive round-trip encoding and decoding intact.
The package provides both a command-line tool (geobuf encode/decode) and a Python API. It supports incremental parsing (reading features as they arrive rather than loading the entire dataset into memory), partial reads (skipping unneeded data), and trivial concatenation of multiple Geobuf files. It's designed as a modern, GeoJSON-native alternative to Shapefile for scenarios where you need compact storage or transmission of geographic datasets without tiling or coordinate projection.
Use it for:
- Compress large GeoJSON datasets for storage or network transmission in web mapping applications.
- Stream geographic features incrementally from a Geobuf file without loading the entire dataset into memory.
- Replace Shapefile workflows with a simpler, JSON-compatible binary format that preserves all properties.
- Reduce bandwidth for serving geographic data to browsers or mobile clients.
- Concatenate multiple geographic datasets by simply appending Geobuf files together.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Geobuf encodes GeoJSON to a compact binary format and decodes it back, achieving 6-8x compression over raw GeoJSON while preserving all data losslessly.
Yes, if you work with GeoJSON and need significant file-size reduction without losing data. The low install friction, permissive license, and active maintenance make it a straightforward choice. The 6-8x compression ratio and support for incremental parsing are genuine advantages for large geographic datasets. No known vulnerabilities and stable API.
Install
geobuf on PyPI
pip
pip install geobufuv
uv add geobufpoetry
poetry add geobufInstalling geobuf
Before you install
Low install friction with three lightweight runtime dependencies (click, protobuf, six). Last release was 206 days ago; the project is archived on GitHub but remains actively maintained by the pygeobuf organization.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal obligations.
Quickstart
pip install geobuf
import geobuf
import json
with open('example.json') as f:
geojson = json.load(f)
pbf = geobuf.encode(geojson) # GeoJSON dict → binary
recovered = geobuf.decode(pbf) # binary → GeoJSON dict
Verify before relying
- Whether Python version support is truly unspecified or if there are practical constraints based on protobuf and six compatibility.
- Performance comparison with native JSON implementations in production workloads.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — click, protobuf, six |
| Maintenance | aging — 206 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,613/month — #14,281 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: geobuf-2.0.1-py3-none-any.whl
Keywords: data, gis, geojson, protobuf
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
polylineEncodes and decodes geographic coordinate…
unclear · top 5,000 on PyPI
topojsontopojson encodes spatial data into TopoJSON…
permissive · top 15,000 on PyPI
bbpbDecode and re-encode Protocol Buffer messages…
permissive · top 15,000 on PyPI
geometConverts between GeoJSON, WKT/WKB, Extended…
permissive · top 5,000 on PyPI
pypolylineEncodes and decodes Google Polyline format…
unclear · top 15,000 on PyPI
geojsonEncodes, decodes, and represents GeoJSON…
permissive · top 5,000 on PyPI
nbtlibRead, write, and edit NBT (Named Binary Tag)…
permissive · top 15,000 on PyPI
pyjpeglsEncodes and decodes image data using the…
permissive · top 15,000 on PyPI
pylzsspylzss decodes and encodes data compressed with…
copyleft · top 15,000 on PyPI
geojson-pydanticProvides Pydantic models that validate and…
permissive · top 5,000 on PyPI