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
//! # kenro
//!
//! SpatiaLite-style spatial SQL for SQLite in pure Rust — PostGIS-compatible
//! `ST_` functions that work with rusqlite, as a loadable extension, and in
//! WASM.
//!
//! kenro is a full spatial SQL engine for SQLite in pure Rust, with zero C
//! dependencies: WKB/WKT/GeoPackage-blob I/O, the DE-9IM predicate family,
//! pure-Rust overlay/repair/buffer, SQL aggregates (`ST_Union`, `ST_AsMVT`),
//! and the helper functions the GeoPackage spatial index triggers require —
//! so a plain SQLite build can maintain a GeoPackage spatial index
//! correctly.
//!
//! Function names and signatures follow PostGIS (SQL/MM `ST_` prefix);
//! PostGIS is the declared reference for semantics. Where kenro differs, it
//! errs loudly — never silently.
//!
//! ```no_run
//! # #[cfg(feature = "rusqlite")]
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let conn = rusqlite::Connection::open("parks.gpkg")?;
//! kenro::register(&conn)?;
//! let wkt: String = conn.query_row(
//! "SELECT ST_AsText(ST_GeomFromGPB(geom)) FROM parks LIMIT 1",
//! [],
//! |r| r.get(0),
//! )?;
//! # Ok(())
//! # }
//! # #[cfg(not(feature = "rusqlite"))]
//! # fn main() {}
//! ```
//!
//! All functions are pure (no I/O, no clock, no randomness): identical input
//! always produces identical output.
pub use ;
pub use Geom;
pub use register;