Geospatial objects Exceptions to the general rules

Copyright © 2015 Open Geospatial Consortium. 31 Abstract DefaultCRSurn:ogc:def:crs:EPSG::900913DefaultCRS ows:WGS84BoundingBox ows:LowerCorner-124.40958558399815 32.50005761536461ows:LowerCorner ows:UpperCorner-114.58848453257575 43.33627233179173ows:UpperCorner ows:WGS84BoundingBox FeatureType ... Should be converted into: { Name: NHDPlusFlowlines:FeatureTypeList, FeatureType: [ { Name: NHDPlusFlowlines:PlusFlowlineVAA_NHDPlus18, Title: PlusFlowlineVAA, Abstract: null, DefaultCRS: urn:ogc:def:crs:EPSG::900913, bbox: [-124.40958558399815 32.50005761536461, -114.58848453257575, 43.33627233179173] } } The corresponding context could be: Using the following context: context: { wfs: http:www.opengis.netwfs2.5, ows: http:www.opengis.netows2.0, geojson: http:ld.geojson.orgvocab, Name: id, Title: ows:Title, Abstract: ows:Abstact, DefaultCRS: wfs:DefaultCRS, bbox: geojson:bbox, } Recommendation 11: Include in the JSON best practice that if a fragment of a XML document contains a geospatial object then when converting to JSON, consider using the GeoJSON equivalent type. Target: OWS.Common 32 Copyright © 2015 Open Geospatial Consortium.

6.2 Derive JSON from UML

Deriving JSON form UML is out of scope of this Engineering Report. The Engineering Report elaborated in the Testbed 9 OGC 12-093 “OWS-9: UML-to-GML-Application- Schema UGAS Conversion Engineering Report”, elaborates on how to derive JSON encodings from UML automatically. 7 Discussion about GeoJSON

7.1 JSON Schema for GeoJSON

In the same way that a GML instance can be described by a GML application schema XSD file a GeoJSON file can be described by a JSON Schema. There are two approaches for this: ฀ A generic JSON schema describing any GeoJSON file. ฀ A specific JSON schema describing a particular GeoJSON file of a particular feature type.

7.1.1 Generic GeoJSON validation

https:github.comfgesample-json-schemastreemastergeojson provides an attempt to generate a GeoJSON generic JSON schema. This can be useful to validate that a JSON file is in fact a GeoJSON file but does not provide the “GML application schema” functionality. We have done a similar exercise during the process of defining a JSON Schema for OWS Context as seen later. { schema: http:json-schema.orgdraft-04schema, title: GeoJSON schema, type: object, required: [ type ], properties: { type: { enum: [ FeatureCollection ] }, id : { type: string, format: uri }, bbox: { type: array, items: { type: array, minItems: 4, items : { type: number } } }, features : { Copyright © 2015 Open Geospatial Consortium. 33 type: array, items: { type: object, required: [ type, properties], properties: { type: { enum: [ Feature ] }, geometry: { ref: definitionsgeometry }, properties: { type: object } } } } }, definitions: { geometry: { title: geometry, type: object, oneOf: [{ properties: { type: { enum: [ Point] }, coordinates: { type: array, minItems: 2, items: { type: number} } } }, { properties: { type: { enum: [ LineString, Multipoint]}, coordinates: { type: array, minItems: 2, items: { type: array, minItems: 2, items : { type: number } } } } }, { properties: { type: { enum: [ Polygon, MultiLineString]}, coordinates: { type: array, items: { type: array, minItems: 2, items: { type: array,