stt_build/lib.rs
1//! Library facade for the stt-build crate.
2//!
3//! The CLI binary lives at `src/main.rs`; this lib target exposes the
4//! same modules so integration tests under `tests/` and external probes
5//! can drive the pipeline programmatically.
6
7/// Shared flag → config parsing (`--temporal-bucket`, `--vector-group`,
8/// `--quantize-*`, per-tile budgets, attribute filters) used by both the
9/// `stt-build` CLI and the `stt-serve` dynamic server, so a live-served tile is
10/// configured byte-identically to one built offline.
11pub mod build_options;
12pub mod clip;
13pub mod columnar;
14/// Decode logic shared by the PostGIS and DuckDB input adaptors (row outcome,
15/// per-vertex coercion tally, dropped-column warning, integer `--time-format`
16/// scaling, NaN→JSON-null) — one definition so the readers can't drift.
17#[cfg(any(feature = "postgres", feature = "duckdb"))]
18pub(crate) mod db_input_common;
19/// DuckDB input source — read features from a DuckDB database (or anything
20/// DuckDB can scan: Parquet/CSV/… via `read_*`) instead of a GeoParquet file.
21/// Gated behind the `duckdb` cargo feature so default builds don't pull the
22/// (statically bundled) database engine.
23#[cfg(feature = "duckdb")]
24pub mod duckdb_input;
25pub mod input;
26/// PostGIS input source — read features from a live PostgreSQL/PostGIS query
27/// instead of a GeoParquet file. Gated behind the `postgres` cargo feature so
28/// default builds don't pull the database driver.
29#[cfg(feature = "postgres")]
30pub mod postgres_input;
31pub mod quadbin;
32pub mod simplify;
33/// Build-time `style_hints` collection (`--style-hints`): bounded per-property
34/// value sampling + layer-kind counting over the loaded features, feeding the
35/// generic profiler in `stt_optimize::analysis::properties`.
36pub mod style_hints;
37pub mod summary;
38pub mod tiler;
39
40/// Encode a single tile's features into an **uncompressed** STT layer-frame
41/// tile payload (Arrow IPC + GeoArrow geometry) for an arbitrary
42/// `(z, x, y, time-bucket)` — without running the full whole-dataset build (no
43/// pack/directory writer, no cross-tile state). These bytes are the frame the
44/// offline build feeds INTO the pack writer *before* per-blob zstd, so a
45/// dynamic per-request tile server (`stt-serve`) can serve them directly. See
46/// [`tiler::encode_single_tile`].
47pub use tiler::{encode_single_tile, encode_single_tile_counted};