JSON GetCapabilities request JSON requests

82 Copyright © 2015 Open Geospatial Consortium.

10.1.4 JSON exception

Subclause 7.4.1 on OWS Common defines an exception report for GetCapabilities and Clause 8 the general rules of the exceptions. In our opinion, we should avoid creating a JSON exception for GetCapabilities and limit ourselves to use the HTTP error levels and appropriate descriptions for them in a more RESTful style.

10.1.5 JSON responses

JSON responses can be provided also when currently an XML response is possible. In this case, the standard will provide a context fragment and eventually a JSON Schema.

10.1.6 Bounding Boxes

Subclause 10.2 on OWS Common defines how to use Bounding Boxes in OWS Common. SubClause 10.2.2 and in the case of JSON encoding whenever possible we should use GeoJSON bbox. Subclause 10.2.1 defines a generic bounding box. CRSbbox: { crs: http:www.opengis.netdefcrsOGC1.3CRS84, LowerCorner: POINT-180 -90, UpperCorner: POINT180 90 }

10.2 JSON in Web Map Services

This subclause discusses how to include JSON in the WMS service.

10.2.1 JSON in GetCapabilities response

The subclause 10.1.1 already discuses this topic in a more general way.

10.2.2 JSON for WMS GetMap response

In the past, several discussions suggested the need to be able on how to get metadata about individual maps returned by a WMS service. A JSON response can be a opportunity to do so: To request a JSON response in GetMap you only have to request the right format: ?service=WMSrequest=GetMapformat=applicationjson Then, the response can contain some information about the map and the map image itself embedded or linked. Copyright © 2015 Open Geospatial Consortium. 83 The following example return the image code embedded in the JSON as base64 encoding { id: 15, box: [-180,-90,180,90], title: Example data fragment, author: ACME Corp., img:{ format: imagegif, data: iVBORw...kJggg== } } The following example return the image code embedded in the JSON as base64 encoding { id: 16, title: Example data fragment, author: ACME Corp., img: { href=?service=WMSrequest=GetMapformat=imagegif } } This encoding ideas reproduce some suggestion coming from: http:json- schema.orglatestjson-schema-hypermedia.html . Another possibility is return GeoJSON vectors and relies on the ability of the map brower to present the information to the client. For example Leaflet map client is able to render GeoJSON on the screen.

10.2.3 JSON for WMS GetFeatureInfo response

GetFeatureInfo response format was left open to the implementations. This was done to make it simple. Since in WMS the data model associated with the features that are represented in the map is not exposed at least in the general case with no SLD support, we cannot rely on the feature type concept. In this case the capability of the JavaScript language and JSON of being able to allow for any set of properties can play in our advantage. It is important that we support both FeatureInfo reports coming from any kind of features including grid coverages. In a general implementation, information can be provided not just about the features were the I,J point is contained but also from its surroundings. In fact some WMS implementations have a “distance” parameter to specify the radius of the circle where the server look inside for features to return information about them see support for the vendor specific parameter “buffer” in geoserver 2.7 http:docs.geoserver.orgstableenuserserviceswmsvendor.html.