geolith-tiles-builder 0.4.2

Builds tiles from OpenStreetMap and Overture Maps: protomaps-schema vector PMTiles, Terrain-RGB, raster archives and 3D Tiles from Gaussian splats
Documentation
#![warn(missing_docs)]

//! geolith-tiles-builder: tiles from OSM and Overture Maps.
//!
//! One module per output type:
//!
//! - the vector tile build, [`run`], writes a protomaps-schema `PMTiles`
//!   archive from Overture Parquet and OSM,
//! - [`terrain`] writes Terrain-RGB `PMTiles` from `GeoTIFF` DEMs,
//! - [`raster`] archives a raster tile service as `PMTiles`,
//! - [`splat`] writes an OGC 3D Tiles tileset from a Gaussian splat,
//! - [`reconstruct`] turns drone video into a splat.
//!
//! The vector build runs in four phases:
//! 1. **Read + Process**: discover Parquet files, read features, route to
//!    layer processors, project to world coordinates, clip to tiles, snap to
//!    tile-local integers, encode MVT geometry commands.
//! 2. **External Sort**: buffer `SortEntry` items, flush sorted chunks to
//!    disk when the buffer exceeds a threshold.
//! 3. **K-Way Merge**: merge all sorted chunks into globally sorted order.
//! 4. **`PMTiles` Write**: group entries by tile, encode MVT tiles, gzip
//!    compress, write the archive in Hilbert order.

pub mod config;
mod disk;
mod fd_limit;
mod fsio;
pub mod geometry;
pub mod layers;
pub mod raster;
pub mod reconstruct;
pub mod sort;
pub mod splat;
pub mod terrain;
pub mod tile;
pub mod timing;

pub use geolith::error;
pub use geolith::output;
pub use geolith::{conflation, progress, source};

pub use config::{DEFAULT_MAX_GEOMETRY_FAILURES, Reuse, TilesConfig};

mod mlt;
mod pipeline;
mod tiles_error;

pub use tiles_error::TilesError;

/// Build the vector tile archive `config` describes: read, sort, merge and
/// write the protomaps-schema `PMTiles` file.
///
/// # Errors
///
/// Propagates any error from reading the sources, sorting, or writing the
/// archive.
pub fn run(config: &TilesConfig) -> Result<(), TilesError> {
    pipeline::execute(config)
}