Skip to main content

Spatial tiling, MVT generation, and tile serving for geospatial data

Project description

Starlet

Spatial tiling, MVT generation, and tile serving for geospatial data.

Setup

python -m venv .venv
source .venv/bin/activate
pip install -e .

CLI

All commands are available through the starlet CLI.

starlet --help

starlet tile — Partition a dataset

starlet tile --input data.parquet --outdir datasets/mydata --num-tiles 40
Flag Default Description
--input (required) Path to GeoParquet or GeoJSON file
--outdir (required) Output dataset directory
--num-tiles 40 Target number of spatial partitions
--partition-size 1gb Target partition size (e.g. 512mb, 1gb)
--sort zorder Sort order: zorder, hilbert, columns, none
--sample-cap 10000 Reservoir sampling cap for centroids
--compression zstd Parquet compression codec

starlet mvt — Generate vector tiles

starlet mvt --dir datasets/mydata --zoom 7 --threshold 100000
Flag Default Description
--dir (required) Dataset directory with parquet_tiles/ and histograms/
--zoom 7 Maximum zoom level
--threshold 0 Minimum feature count per tile
--outdir <dir>/mvt/ MVT output directory

starlet build — Full pipeline (tile + MVT)

starlet build --input data.parquet --outdir datasets/mydata

starlet serve — Launch the tile server

starlet serve --dir datasets --port 8765
Flag Default Description
--dir (required) Root directory containing dataset subdirectories
--host 0.0.0.0 Host to bind
--port 8765 Port to bind
--cache-size 256 In-memory tile cache size

starlet info — Inspect a dataset

starlet info --dir datasets/mydata

Make Targets

Convenience wrappers around the CLI:

make tiles INPUT=path/to/data.parquet
make mvt   INPUT=path/to/data.parquet
make build INPUT=path/to/data.parquet   # tiles + mvt
make server                              # starts on port 8765
make clean                               # removes datasets/*

API Endpoints

Once the server is running:

Method Path Description
GET / Interactive dataset selector
GET /api/datasets List all datasets
GET /datasets.json Search datasets by name
GET /datasets/<dataset>.json Dataset metadata
GET /datasets/<dataset>.html Dataset detail page
GET /<dataset>/<z>/<x>/<y>.mvt Mapbox Vector Tile
GET /datasets/<dataset>/features.<fmt> Download features (csv/geojson)
POST /datasets/<dataset>/features.<fmt> Download with geometry filter
GET /datasets/<dataset>/features/sample.json Sample attributes
GET /datasets/<dataset>/features/sample.geojson Sample record with geometry
GET /api/datasets/<dataset>/stats Attribute statistics

Example

# Full pipeline
starlet build --input ../data/TIGER2018_COUNTY.parquet --outdir datasets/TIGER2018_COUNTY

# Or via Make
make build INPUT=../data/TIGER2018_COUNTY.parquet

# Start the server
make server

Then open http://localhost:8765 and select a dataset to visualize.

Prerequisites

  • Python 3.10+
  • make (optional, for convenience targets)

Development

Running Tests

pip install -e ".[dev]"
pytest tests/ -v

Creating a Release

See RELEASE.md for the complete release process, including:

  • Where to update version numbers
  • How to create and push release tags
  • Automated CI/CD workflow details
  • Troubleshooting guide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlet-0.3.0.tar.gz (86.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starlet-0.3.0-py3-none-any.whl (103.3 kB view details)

Uploaded Python 3

File details

Details for the file starlet-0.3.0.tar.gz.

File metadata

  • Download URL: starlet-0.3.0.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for starlet-0.3.0.tar.gz
Algorithm Hash digest
SHA256 674077524d01a7a335e7fd7c3e17c3aec8e324b01aecbc72fe5090121796a3b1
MD5 36fd06d20fd16d484a5670f470931118
BLAKE2b-256 51aa3c1f2ecde12b651a53678cc66ee50244681eabcf63b1c252361248961b02

See more details on using hashes here.

Provenance

The following attestation bundles were made for starlet-0.3.0.tar.gz:

Publisher: publish.yml on ucr-bdlab/starlet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starlet-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: starlet-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 103.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for starlet-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1a2b6a2d8b13da03c6ca8d4d9644d697cb0cc859bf09cbd0d3df90650cb5b66
MD5 0a4e88fd5d8b4c2b06dbd12d24bb5e9e
BLAKE2b-256 49658185076d8e7c9449e3b7aba0fb7ac91bbbfb2728a237a9774b1107ad16b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for starlet-0.3.0-py3-none-any.whl:

Publisher: publish.yml on ucr-bdlab/starlet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page