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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! The parts of the [OGC GeoPackage](https://www.geopackage.org/spec140/)
//! format that don't need a database.
//!
//! This crate contains the geometry codec, table definitions and validation
//! rules of GeoPackage 1.4, with no SQLite dependency. Most users want the
//! `geopackage` crate, which builds the SQLite container on top of this one.
//! Use this crate directly for format code without SQLite: in a fuzz target,
//! for example, or another GeoPackage implementation.
//!
//! # Modules
//!
//! - **[`gpb`]**: The GeoPackage Binary (GPB) geometry header codec
//! - **[`geometry`]**: A parsed geometry view ([`GpbGeometry`]), and GPB
//! encoders for geometry objects and existing ISO WKB
//! - **[`curve`]**: Envelopes read directly from ISO WKB, including exact
//! extents for circular arcs
//! - **[`types`]**: Column and geometry types (spec Table 1, Annex G)
//! - **[`datetime`]**: `DATE` and `DATETIME` parsing, strict or lenient, with
//! calendar validation and epoch conversion
//! - **[`ddl`]**: `CREATE TABLE` statements and the required
//! `gpkg_spatial_ref_sys` rows
//! - **[`srs`]**: A subset of EPSG WKT1 definitions for
//! `gpkg_spatial_ref_sys`
//! - **[`triggers`]**: RTree spatial index tables and triggers, by spec
//! version
//! - **[`tiles`]**: Tile pyramid table definitions and the tile matrix model
//! - **[`coverage`]**: Payload rules for tiled gridded coverages, checked from
//! the TIFF or PNG header
//! - **[`schema`]**: Column descriptions and value constraints from the
//! `gpkg_schema` extension (Annex F.9)
//! - **[`metadata`]**: Metadata records and references from the
//! `gpkg_metadata` extension (Annex F.8)
//! - **[`related`]**: Relationships from the Related Tables Extension
//! (OGC 18-000)
//! - **[`version`]**: `application_id` and `user_version` handling
//! - **[`ident`]**: SQL identifier quoting
//!
//! SQL is copied verbatim from the spec's Annex C ("Table Definition SQL") and
//! Annex F.3 ("R-tree Spatial Indexes").
//!
//! # Example
//!
//! Encode a geometry as a GPB blob and parse it back:
//!
//! ```
//! # #[cfg(feature = "geo-types")]
//! # fn main() -> Result<(), geopackage_core::Error> {
//! use geopackage_core::GpbGeometry;
//! use geopackage_core::geometry::encode_gpb;
//!
//! let point = geo_types::Point::new(-6.26, 53.35);
//! let (blob, envelope) = encode_gpb(&point, 4326)?;
//! assert_eq!(envelope, Some([-6.26, -6.26, 53.35, 53.35]));
//!
//! let parsed = GpbGeometry::parse(&blob)?;
//! assert_eq!(parsed.header().srs_id, 4326);
//! assert_eq!(parsed.xy_envelope(), envelope);
//! # Ok(()) }
//! # #[cfg(not(feature = "geo-types"))]
//! # fn main() {}
//! ```
//!
//! # Cargo features
//!
//! - **`geo-types`** (default): Enables [`GpbGeometry::to_geo`], which converts
//! a parsed geometry to a `geo-types` geometry. The [`geo_traits`]
//! implementation doesn't need it
// `unsafe_code = "forbid"` and `missing_docs = "warn"` come from the
// workspace lints table (root Cargo.toml). This crate never uses `unsafe`; the
// `geopackage-ffi` crate is the sole exception, and opts out of the workspace
// lints rather than relaxing them here.
pub use Error;
pub use ;
pub use ;
pub use SrsDefinition;
pub use ;
pub use ;
pub use GpkgVersion;