geolith_tiles_builder/lib.rs
1#![warn(missing_docs)]
2
3//! geolith-tiles-builder: tiles from OSM and Overture Maps.
4//!
5//! One module per output type:
6//!
7//! - the vector tile build, [`run`], writes a protomaps-schema `PMTiles`
8//! archive from Overture Parquet and OSM,
9//! - [`terrain`] writes Terrain-RGB `PMTiles` from `GeoTIFF` DEMs,
10//! - [`raster`] archives a raster tile service as `PMTiles`,
11//! - [`splat`] writes an OGC 3D Tiles tileset from a Gaussian splat,
12//! - [`reconstruct`] turns drone video into a splat.
13//!
14//! The vector build runs in four phases:
15//! 1. **Read + Process**: discover Parquet files, read features, route to
16//! layer processors, project to world coordinates, clip to tiles, snap to
17//! tile-local integers, encode MVT geometry commands.
18//! 2. **External Sort**: buffer `SortEntry` items, flush sorted chunks to
19//! disk when the buffer exceeds a threshold.
20//! 3. **K-Way Merge**: merge all sorted chunks into globally sorted order.
21//! 4. **`PMTiles` Write**: group entries by tile, encode MVT tiles, gzip
22//! compress, write the archive in Hilbert order.
23
24pub mod config;
25mod disk;
26mod fsio;
27pub mod geometry;
28pub mod layers;
29pub mod raster;
30pub mod reconstruct;
31pub mod sort;
32pub mod splat;
33pub mod terrain;
34pub mod tile;
35pub mod timing;
36
37pub use geolith::error;
38pub use geolith::output;
39pub use geolith::{conflation, progress, source};
40
41pub use config::{Reuse, TilesConfig};
42
43mod mlt;
44mod pipeline;
45mod tiles_error;
46
47pub use tiles_error::TilesError;
48
49/// Build the vector tile archive `config` describes: read, sort, merge and
50/// write the protomaps-schema `PMTiles` file.
51///
52/// # Errors
53///
54/// Propagates any error from reading the sources, sorting, or writing the
55/// archive.
56pub fn run(config: &TilesConfig) -> Result<(), TilesError> {
57 pipeline::execute(config)
58}