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
//! Terrana — zero-config spatial queries and geodesic geometry.
//!
//! Point Terrana at a CSV, Parquet, GeoJSON, or DuckDB file with lat/lon columns
//! and run spatial queries and geodesic geometry operations against it — no
//! database setup required.
//!
//! # Two ways to use the crate
//!
//! **As a library** (no HTTP server). Load a file with [`ingest_file`], then run
//! SQL-backed spatial queries via [`db::query`] or geodesic computations via
//! [`geometry`]:
//!
//! ```no_run
//! use terrana::{db, ingest_file};
//!
//! let conn = db::create_connection()?;
//! let info = ingest_file(&conn, std::path::Path::new("observations.csv"), None, None, None)?;
//! println!("loaded {} rows; lat={}, lon={}", info.row_count, info.lat_col, info.lon_col);
//! # Ok::<(), terrana::AppError>(())
//! ```
//!
//! **As an HTTP server** (the `server` feature, enabled by default). The binary
//! and the [`server`] module assemble an [`axum`](https://docs.rs/axum) router
//! over the same primitives. Disable default features to depend on the pure
//! library without pulling in axum/tokio:
//!
//! ```toml
//! terrana = { version = "0.2", default-features = false }
//! ```
//!
//! # Geodesic rules
//!
//! Area, perimeter, explicit distance, and buffer geometry use geodesic
//! algorithms on the WGS 84 ellipsoid (Karney / Vincenty via the `geo` crate),
//! never planar math. See [`geometry`].
// Pure library — always available, no HTTP dependencies.
// HTTP server layer — gated so library-only consumers avoid axum/tokio/tower.
// The most useful items re-exported at the crate root.
pub use ;
pub use query;
pub use AppError;