PMTiles generation plugin for geoparquet-io
Project description
gpio-pmtiles
⚠️ DEPRECATED: This plugin is deprecated. PMTiles support is now built into geoparquet-io core. Use
gpio pmtiles create(CLI) orgeoparquet_io.api.ops.create_pmtiles()(Python). See the GeoJSON guide for usage.
PMTiles generation plugin for geoparquet-io.
Overview
This plugin provides integrated PMTiles generation from GeoParquet files by orchestrating a streaming pipeline:
GeoParquet → [reproject] → [filter] → [convert to GeoJSON] → [tippecanoe] → PMTiles
All filtering, reprojection, and conversion happens in-memory through Unix pipes—no intermediate files needed.
Why use this plugin instead of manual piping?
- Simpler API: Single command handles the entire pipeline with sensible defaults
- Built-in CRS handling: Automatically reprojects to WGS84 if needed
- Better error messages: Clear guidance for common issues (tippecanoe missing, invalid paths)
- Quality defaults: Pre-configured tippecanoe settings for production use
Installation
# As a CLI tool
uv tool install geoparquet-io --with gpio-pmtiles
# For Python library use
pip install geoparquet-io gpio-pmtiles
Requirements:
- tippecanoe must be installed and available in PATH
- macOS:
brew install tippecanoe - Ubuntu:
sudo apt install tippecanoe
- macOS:
Quick Start
# Basic conversion
gpio pmtiles create buildings.parquet buildings.pmtiles
# With spatial filtering
gpio pmtiles create data.parquet filtered.pmtiles \
--bbox "-122.5,37.5,-122.0,38.0"
# With attribute filtering and column selection
gpio pmtiles create data.parquet cities.pmtiles \
--where "population > 10000" \
--include-cols name,population,area
# With CRS override (if metadata is incorrect)
gpio pmtiles create data.parquet tiles.pmtiles --src-crs EPSG:3857
# From S3 with AWS profile
gpio pmtiles create s3://bucket/data.parquet tiles.pmtiles --profile my-aws-profile
Python API
The plugin also provides a Python API:
from gpio_pmtiles import create_pmtiles_from_geoparquet
# Basic usage
create_pmtiles_from_geoparquet(
input_path="buildings.parquet",
output_path="buildings.pmtiles"
)
# With filtering
create_pmtiles_from_geoparquet(
input_path="data.parquet",
output_path="tiles.pmtiles",
bbox="-122.5,37.5,-122.0,38.0",
where="population > 10000",
include_cols="name,type,height",
min_zoom=0,
max_zoom=14
)
# With CRS override
create_pmtiles_from_geoparquet(
input_path="data.parquet",
output_path="tiles.pmtiles",
src_crs="EPSG:3857" # Reproject from EPSG:3857 to WGS84
)
CLI Options
| Option | Description |
|---|---|
--layer, -l |
Layer name in PMTiles (defaults to output filename) |
--min-zoom |
Minimum zoom level (use with --max-zoom or auto-detect) |
--max-zoom |
Maximum zoom level (auto-detected if not specified) |
--bbox |
Bounding box filter: minx,miny,maxx,maxy |
--where |
SQL WHERE clause for filtering rows |
--include-cols |
Comma-separated list of columns to include |
--precision |
Coordinate decimal precision (default: 6 for ~10cm accuracy) |
--src-crs |
Source CRS if metadata is incorrect (will reproject to WGS84) |
--attribution |
Attribution HTML for tiles (defaults to geoparquet-io link) |
--profile |
AWS profile name for S3 files |
--verbose, -v |
Show progress and commands being executed |
How It Works
Plugin System
This plugin uses the entry points system to register itself with geoparquet-io. When installed, it automatically adds the pmtiles command group to the gpio CLI.
Pipeline Architecture
The plugin orchestrates a subprocess pipeline:
- Reprojection (if
--src-crsspecified):gpio convert reproject - Filtering (if bbox/where/include-cols specified):
gpio extract - GeoJSON conversion:
gpio convert geojsonwith streaming output - Tile generation:
tippecanoewith production-quality settings
All stages communicate through Unix pipes for memory efficiency. No intermediate files are created.
Manual Pipeline Alternative
If you prefer manual control, you can achieve the same result with pipe commands:
# Plugin version (simple)
gpio pmtiles create data.parquet tiles.pmtiles --bbox "-122,37,-121,38"
# Equivalent manual pipeline
gpio extract data.parquet --bbox "-122,37,-121,38" | \
gpio convert geojson - | \
tippecanoe -P -o tiles.pmtiles -zg --simplify-only-low-zooms
The plugin provides better defaults and error handling, but manual piping offers more flexibility.
Coordinate Precision
The --precision option controls decimal places for coordinates:
| Precision | Accuracy | Use Case |
|---|---|---|
| 7 | ~1cm | High accuracy applications |
| 6 (default) | ~10cm | Most mapping use cases |
| 5 | ~1m | City-level visualization |
| 4 | ~10m | Regional maps |
# Reduce precision for smaller files
gpio pmtiles create data.parquet output.pmtiles --precision 5
Development
Contributions are welcome! See CLAUDE.md for development guidelines
# Clone and install
git clone https://github.com/geoparquet/gpio-pmtiles.git
cd gpio-pmtiles
uv sync --all-extras
# Run tests
uv run pytest
# Format and lint
uv run ruff format .
uv run ruff check --fix .
Related Documentation
- geoparquet-io Documentation - Full user guide and API reference
- GeoJSON Conversion Guide - Detailed streaming and conversion options
- tippecanoe documentation - Tile generation options
- PMTiles specification - PMTiles format details
Links
- PyPI: https://pypi.org/project/gpio-pmtiles/
- Issues: https://github.com/geoparquet/gpio-pmtiles/issues
- Parent Project: https://github.com/geoparquet/geoparquet-io
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gpio_pmtiles-0.2.0.tar.gz.
File metadata
- Download URL: gpio_pmtiles-0.2.0.tar.gz
- Upload date:
- Size: 196.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce51abb350eb484325c1e30dc60cd82f20d8190f0ff3b641d5ff800af1d1c46c
|
|
| MD5 |
4b1ddeedd8c58603016106a3835a045e
|
|
| BLAKE2b-256 |
cb7d35f870fa181a96bf4395bd54196b5118483e11daf25737754cf736213dfa
|
Provenance
The following attestation bundles were made for gpio_pmtiles-0.2.0.tar.gz:
Publisher:
publish.yml on geoparquet-io/gpio-pmtiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpio_pmtiles-0.2.0.tar.gz -
Subject digest:
ce51abb350eb484325c1e30dc60cd82f20d8190f0ff3b641d5ff800af1d1c46c - Sigstore transparency entry: 1400800225
- Sigstore integration time:
-
Permalink:
geoparquet-io/gpio-pmtiles@3675f942e2742b007eea56a67125946bdedd2018 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/geoparquet-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3675f942e2742b007eea56a67125946bdedd2018 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gpio_pmtiles-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gpio_pmtiles-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a1d7e3d9e7faed24c11128e0fd2470ac9e7e478428a5480ec8a6dc66c22257d
|
|
| MD5 |
55d36981a12d595b73415c85feb5ec96
|
|
| BLAKE2b-256 |
fbe91d8173559da8f35957bb6e5d208ef2584674f1c467558a2234d052a31630
|
Provenance
The following attestation bundles were made for gpio_pmtiles-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on geoparquet-io/gpio-pmtiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpio_pmtiles-0.2.0-py3-none-any.whl -
Subject digest:
5a1d7e3d9e7faed24c11128e0fd2470ac9e7e478428a5480ec8a6dc66c22257d - Sigstore transparency entry: 1400800309
- Sigstore integration time:
-
Permalink:
geoparquet-io/gpio-pmtiles@3675f942e2742b007eea56a67125946bdedd2018 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/geoparquet-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3675f942e2742b007eea56a67125946bdedd2018 -
Trigger Event:
release
-
Statement type: