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
57
58
59
//! # geonative-shapefile
//!
//! Pure-Rust reader for the Esri Shapefile family (`.shp` + `.shx` + `.dbf`
//! + optional `.prj` / `.cpg`). No GDAL, no shapelib.
//!
//! ## What v0.1 covers
//!
//! - 2D shape types: `Null`, `Point`, `Polyline`, `Polygon`, `MultiPoint`
//! - DBF field types: `C` (char), `N` (numeric), `F` (float), `D` (date),
//! `L` (logical); other DBF types come through as `Value::String` or `Null`
//! - Ring orientation flipped from Shapefile (CW outer / CCW hole) to OGC
//! (CCW outer / CW hole) so polygons match the rest of the geonative IR
//! - `.shp` is **mmapped** for bounded RAM usage on multi-GB inputs;
//! `.shx` + `.dbf` are read into Vecs (small)
//!
//! ## v0.1 scope cuts
//!
//! - Z/M variants (PointZ, PolygonZ, MultipointZ, etc.) return Unsupported
//! - MultiPatch (type 31) — surface-class geometry; defer
//! - Non-UTF-8 codepages (`.cpg` / LDID full table) — defer; v0.1 treats
//! string bytes as UTF-8 with replacement for invalid sequences
//! - `.qix` / `.sbn` spatial index files — ignored
//! - Sparse / corrupt-`.shx` repair — error rather than auto-rebuild
//!
//! ## Usage
//!
//! ```no_run
//! let shp = geonative_shapefile::Shapefile::open("roads.shp")?;
//! println!("{} features, schema: {:?}", shp.feature_count(), shp.schema());
//! for f in shp.read() {
//! let f = f?;
//! // f.fid, f.geometry, f.attributes
//! }
//! # Ok::<(), geonative_shapefile::ShpError>(())
//! ```
// We `deny` rather than `forbid` so the single mmap call in `dataset.rs`
// can explicitly opt in via `#[allow(unsafe_code)]`. Every other module
// remains safe-Rust-only.
pub use ;
pub use ;
pub use ;
/// Convenience: open a `.shp` (or any file in the shapefile triad) and
/// produce a `Shapefile` handle.