navibyte / geospatial

Geospatial data structures, tools and utilities for Dart and Flutter.
Other
54 stars 5 forks source link

Support for OGC Features and Geometries JSON : Core #53

Open navispatial opened 2 years ago

navispatial commented 2 years ago

Support for OGC Features and Geometries JSON.

The spec defines:

First - as described in this issue - add support for core conformance / requirement class. Support for 3D and Feature Types and Schemas could be implemented later in the future.

navispatial commented 2 years ago

draft spec for OGC Features and Geometries JSON - Part 1: Core

navispatial commented 6 months ago

On standard GitHub page see also latest editor's draft.

Some copied snippets from the standard editorial draft to help analyzing needs.. Implementing these properly is NOT a trivial task for any clients or servers maybe??

Requirement / conformance classes

"Core": The Core conformance class extends GeoJSON with additional members that specify how Temporal information, extended Geometry information and Reference systems information can be encoded in a JSON-FG document. In addition, Metadata is added to declare the JSON-FG conformance classes that the JSON document conforms to. The Core conformance class has a dependency on GeoJSON. This means that a JSON-FG document that conforms to Core must also conform to GeoJSON.

"3D": The 3D conformance class adds support for Polyhedron, MultiPolyhedron, Prism, and MultiPrism geometries in a 3D CRS. The 3D conformance class has a dependency on the Core conformance class. This means that a JSON-FG document that conforms to the 3D conformance class must also conform to the Core conformance class.

"Feature Types and Schemas": The Feature Types and Schemas conformance class adds support for Feature types and Feature schemas. Features are often categorized by type. This requirements class adds members to a JSON-FG document so that contained features can be tagged with a type value. This conformance class includes guidance about how to include information about the feature schema in a JSON-FG document. The Feature Types and Schemas conformance class has a dependency on the Core conformance class. This means that a JSON-FG document that conforms to the Feature Types and Schemas conformance class must also conform to the Core conformance class.

Background - coordinate reference systems

Spatio-temporal objects are specified relative to some reference system

GeoJSON (both the current RFC and the legacy version) fixed the reference system for geometric values to the "WGS84 datum, and with [an axis order of] longitude and latitude [and coordinate] units of decimal degrees". The legacy version included a "prior arrangement" provision to allow other reference systems to be used and to also defined the "crs" key for specifying the reference system. This prior arrangement mechanism survived into the RFC but the accompanying "crs" key did not. The result is that there is no interoperable way to unambiguously specify a different CRS in GeoJSON. As such, the only safe approach is to continue using OGC:CRS84(h) for GeoJSON and ignore the prior arrangement provision and the old "crs" key.

Additional JSON-FG building blocks like the "place" member are not bound by these restrictions and so this Standard provides for handling reference systems in JSON-FG documents in a way that does not interfere with anything, past or present, defined in any of the GeoJSON specifications. The GeoJSON building blocks can continue to operate as always but JSON-FG building blocks provides enhanced CRS support.

Requirements for coordinate reference systems

A reference system can be specified in a JSON-FG document using a "coordRefSys" member...:

Scoping rules

The order in which coordinates for JSON-FG geometry objects are expressed is defined in the OGC Axis Order Policy and shall be in the axis order defined by the closest-to-scope CRS metadata.

For unknown coordinate reference systems, such as with CAD engineering drawings, the following CRS identifiers can be used:

The CRS of a "place" geometry object is determined as follows:

If the "place" member in any JSON-FG feature in the JSON document is not null and the geometry type (member "type") is "GeometryCollection" or any other geometry type that has embedded geometry objects, no embedded geometry object SHALL include a "coordRefSys" member.