Features - JSON-FGspecdraftimplcandidate
Encode features as JSON-FG.
Scope
GeoJSON is a popular encoding for feature data. It is the default encoding for features in ldproxy. However, GeoJSON has intentional restrictions that prevent or limit its use in certain contexts. For example, GeoJSON is restricted to WGS 84 coordinates, does not support volumetric geometries and has no concept of classifying features according to their type.
OGC Features and Geometries JSON (JSON-FG) is an OGC proposal for GeoJSON extensions that provide standard ways to support such requirements.
By default, the geometry
and place
members will be based on the same geometry property in the feature schema. In some cases, it can be appropriate to use different properties. For example, if a building feature has a solid geometry and a footprint geometry, a useful approach can be to provide the solid in place
and the footprint in geometry
/ GeoJSON. To use a different geometry property in place
, specify the property name.*
Conformance Classes
The building block is based on draft 0.2.1 of JSON-FG. The implementation will change as the draft will evolve during the standardization process.
Configuration
Options
Name | Default | Description | Type | Since |
---|---|---|---|---|
buildingBlock | Always JSON_FG . | string | v2.0 | |
enabled | false | Enable the building block? | boolean | v2.0 |
transformations | {} | Property transformations do not affect data sources, they are applied on-the-fly as part of the encoding. Filter expressions do not take transformations into account, they have to be based on the source values. That means queryable properties (see queryables in Features) should not use transformations in most cases. The exception to the rule is the HTML encoding, where readability might be more important than filter support. | object | v2.0 |
defaultProfiles | {} | Allows to change the default value of the profile parameter for a specific format. The key is the kind of profile, e.g. rel or val . The value is the default profile value, e.g. rel-as-uri or val-as-title . If only some or no profile kinds are set, the application defaults apply. | object | v4.2 |
describedby | false | Partially Deprecated For schemas specific to the feature type, use schemaCollection and schemaFeature . Enables that links to the generic JSON-FG and GeoJSON JSON Schema documents are added to the JSON-FG response document. The links have the link relation type "describedby". The schemas can be used to validate the JSON document. | boolean | v3.1 |
schemaCollection | null | The URI of a JSON Schema document describing a feature collection with the features of the collection/dataset. The schema will be referenced from JSON-FG feature collection responses by a link with the link relation type "describedby". The schemas can be used to validate the JSON document. | string | v3.5 |
schemaFeature | null | The URI of a JSON Schema document describing a feature of the collection/dataset. The schema will be referenced from JSON-FG feature responses by a link with the link relation type "describedby". The schemas can be used to validate the JSON document. | string | v3.5 |
coordRefSys | true | Activates the output of the coordinate reference system in a JSON member "coordRefSys" for features and feature collections. The coordinate reference system is identified by its OGC URI, for example, http://www.opengis.net/def/crs/EPSG/0/25832 for ETRS89 / UTM 32N. | boolean | v3.1 |
geojsonCompatibility | true | Activates support for the "compatibility=geojson" media type parameter. If the parameter is provided, JSON-FG features with a "place" member that is not null will also include a GeoJSON geometry in the "geometry" member in WGS 84. If the parameter is missing, the "geometry" member of a JSON-FG feature will be null , if the "place" member is not null . | boolean | v3.3 |
featureType | see description | Features are often categorized by type. Typically, all features of the same type have the same schema and the same properties. Many GIS clients depend on knowledge about the feature type when processing feature data. For example, when associating a style to a feature in order to render that feature on a map. This option adds a "featureType" member with the specified values. If a single value is specified, then a string is added, otherwise an array of strings. A value can include a template {{type}} , which will be replaced with the value of the feature property with role: TYPE in the provider schema of the feature type of the collection. The property must be of type STRING . If the feature type in the provider schema includes an objectType value, the value will be used as the default. Otherwise, the default is an empty array. | array | v3.1 |
useCuries | false | If true , values in "conformsTo" and "coordRefSys" will be Safe CURIEs, not HTTP URIs. For example, [EPSG:25832] instead of http://www.opengis.net/def/crs/EPSG/0/25832 . | boolean | v3.6 |
links | [] | Adds the specified links to the links array of features. All values of the array must be a valid link object with href and rel . | array | v3.1 |
includeInGeoJson | [] | The option allows selected JSON-FG extensions to be included in the GeoJSON encoding as well. Allowed values are: describedby , featureType , featureSchema , time , place , coordRefSys , links . conformsTo is only used in JSON-FG responses. | array | v3.1 |
Examples
Example of the information in the configuration file for the entire API (from the API for Topographic Data in Daraa, Syria):
- buildingBlock: JSON_FG
enabled: true
featureType:
- nas:{{type}}
Additional information per feature collection with an attribute F_CODE
(for which role: TYPE
was set in the provider configuration) to set the object type:
- buildingBlock: JSON_FG
featureType:
- nas:{{type}}
This outputs the object type as follows for a value of "GB075" in the 'F_CODE' attribut:
{
"type": "Feature",
"id": 1,
"featureType": "nas:GB075",
...
}