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
//! Types for **OGC Features and Geometries JSON** ([JSON-FG]), the OGC extension of
//! GeoJSON standardized as OGC 21-045r1 (version 1.0).
//!
//! JSON-FG is a strict superset of GeoJSON. It adds, as GeoJSON foreign members, the
//! ability to convey:
//!
//! - geometry in a coordinate reference system other than WGS 84, via the
//! [`place`](Feature::place) member and [`coordRefSys`](CoordRefSys);
//! - geometry types beyond GeoJSON: solids ([`Geometry::Polyhedron`],
//! [`Geometry::Prism`], …) and curves ([`Geometry::CircularString`],
//! [`Geometry::CurvePolygon`], …);
//! - temporal information via [`time`](Feature::time);
//! - feature classification via [`featureType`](Feature::feature_type) and
//! [`featureSchema`](Feature::feature_schema).
//!
//! This crate is the JSON-FG counterpart to the [`geojson`] crate: a serde-based data
//! model, with no I/O or content-negotiation logic. Enable the `geojson` feature for
//! conversions to and from `geojson::Geometry`.
//!
//! # Example
//!
//! ```
//! use jsonfg::{conformance, CoordRefSys, Feature, Geometry};
//!
//! // A feature whose geometry is a point in a projected CRS (EPSG:3857): the native
//! // geometry goes in `place`, and `geometry` (the GeoJSON member) is left null.
//! let mut feature = Feature::new();
//! feature.conforms_to = Some(vec![conformance::CORE.to_owned()]);
//! feature.coord_ref_sys = Some(CoordRefSys::from_epsg(3857));
//! feature.place = Some(Geometry::point(vec![100.0, 200.0]));
//!
//! let json = serde_json::to_value(&feature).unwrap();
//! assert_eq!(json["place"]["type"], "Point");
//! assert!(json["geometry"].is_null());
//! ```
//!
//! [JSON-FG]: https://docs.ogc.org/is/21-045r1/21-045r1.html
//! [`geojson`]: https://docs.rs/geojson
pub use ;
pub use ;
pub use ;
pub use ;
pub use Measures;
pub use ;
pub use NotGeoJson;
/// A JSON object: an ordered map of string keys to arbitrary JSON values. Used for
/// feature properties and for preserved foreign members.
pub type JsonObject = Map;