Expand description
Shortbread vector tile generator.
Elivagar reads OpenStreetMap PBF files and produces PMTiles v3 archives with the Shortbread schema (26 layers).
§Usage
The primary entry point is run(), which takes a TilegenConfig and
drives the full pipeline:
let config = elivagar::TilegenConfig {
pbf_path: "input.osm.pbf".into(),
output_path: "output.pmtiles".into(),
tmp_dir: "data/tilegen_tmp".into(),
min_zoom: 0,
max_zoom: 14,
ocean_shapefile: None,
ocean_simplified_shapefile: None,
ocean_tiles: None,
ocean_artifact_key: None,
ocean_only_metadata: false,
skip_to: None,
in_memory: false,
compression_level: 6,
force_sorted: false,
allow_unsafe_flat_index: false,
threads: std::thread::available_parallelism().map(|n| n.get()).unwrap_or(4),
way_inflight_budget: 0,
assemble_batch_budget: 0,
sort_chunk_size: 0,
locations_on_ways: false,
tile_format: elivagar::TilePayloadFormat::Mvt,
tile_compression: elivagar::TileCompression::Gzip,
compress_sort_chunks: elivagar::sort::ChunkCompression::None,
seam_reconcile_layers: {
let mut m = [0u8; elivagar::shortbread::Layer::count()];
m[elivagar::shortbread::Layer::Boundaries as usize] = 8;
m
},
fanout_caps: [0; elivagar::shortbread::Layer::count()],
polygon_simplify_factor: 1.0,
};
elivagar::run(&config).expect("pipeline failed");§Pipeline phases
- PBF read - single-pass read building node/way indices and emitting sort records for matched features.
- Ocean - ocean shapefile processing (optional). Generates water polygon tiles from an ESRI shapefile.
- Sort - external merge sort of all records by Hilbert tile ID.
- Assembly - MVT protobuf encode, gzip compress, and write PMTiles archive.
The SkipTo enum allows resuming from a checkpoint, reusing sort chunks
from a previous run.
§PMTiles writer
The pmtiles_writer module is also public for standalone use. It writes
clustered PMTiles v3 archives with Hilbert-ordered tile IDs and content
deduplication.
Modules§
- inspect
- PMTiles v3 archive inspector.
- node_
index - pmtiles_
reader - Minimal PMTiles v3 reader.
- pmtiles_
writer - PMTiles v3 archive writer.
- provenance
- Provenance recorded in PMTiles archive metadata under the
elivagarkey. - shortbread
- sort
- svg
- Render a single MVT tile from a PMTiles archive as SVG.
- tile_
detail - MVT tile decoder producing structural detail for out-of-crate adjudication.
- verify
- PMTiles output verification.
Structs§
- Pipeline
Error - Pipeline error type. Stringly-typed because no caller inspects variants - errors are only displayed or propagated. An enum would add boilerplate for no benefit.
- Tilegen
Config - Configuration for the tile generation pipeline.
Enums§
- Ocean
Mode - Ocean producer selected for the checkpointed chunk set.
- SkipTo
- Which pipeline phase to skip to.
- Tile
Compression - Tile compression algorithm for MVT payloads.
- Tile
Payload Format - Tile payload encoding format stored in PMTiles tile data.
Functions§
- ocean_
build - Build the durable world-ocean artifact without opening an OSM PBF. It uses the normal ocean, external-sort, and partitioned assembly path so artifact bytes obey the same encoding and compression rules as runtime ocean tiles.
- run
- Errors