1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! Shortbread vector tile generator.
//!
//! Elivagar reads OpenStreetMap PBF files and produces
//! [PMTiles v3](https://github.com/protomaps/PMTiles) archives with the
//! [Shortbread](https://shortbread-tiles.org/) schema (26 layers).
//!
//! # Usage
//!
//! The primary entry point is [`run()`], which takes a [`TilegenConfig`] and
//! drives the full pipeline:
//!
//! ```no_run
//! 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
//!
//! 1. **PBF read** - single-pass read building node/way indices and emitting
//! sort records for matched features.
//! 2. **Ocean** - ocean shapefile processing (optional). Generates water polygon
//! tiles from an ESRI shapefile.
//! 3. **Sort** - external merge sort of all records by Hilbert tile ID.
//! 4. **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.
extern crate alloc;
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub use TileCompression;
pub use TilePayloadFormat;
pub use ;