84
Copyright © 2015 Open Geospatial Consortium.
We propose a special use of GeoJSON to respond to GetFeatureInfo. The GeoJSON will contain a collection of features where each one will represent a feature in the original
data. In the “geometry” part, we return a GeoJSON point when the feature was covering or touching the I,J position or a GeoJSON string formed by two 2 vertices that goes from
the CRS values of the point where the place I,J where pointing and a point that is in the interior or the border of the returned feature. In the “properties” part we could return the
properties of this feature.
{ type: FeatureCollection,
features: [
{ type: Feature,
geometry: {
type: Point, coordinates:
[-47.314159, 45.3141519], },
id: 20245062, properties:
{ COMID: 20245062,
FDATE: 1999-11-24T06:00:00Z, LENGTHKM: 5.415,
REACHCODE: 16060014044574 }
} ]
}
Please note that we recommend that features are well identified. We are not recommending returning the full geometry description because we assume that this is the
work of a WFS GetFeature operation using identifiers recovered by the GetFeatureInfo request.
Recommendation 28: In WMS 1.4 include a encoding for GetFeatureInfo responses based on GeoJSON but replacing the geometry part by maker of the position of the query and the position of
the returned feature. If returned objects correspond to simple features, return an “id” that allows recovering the geometry using an additional WFS query.
Target: WMS.SWG
Copyright © 2015 Open Geospatial Consortium.
85
10.3 JSON in Web Map Tile Service
10.3.1 JSON in Map Tile Service
It is worth mentioning that a very simple open specification linked to what it seems a single vendor called tileJSON has already been produced to describe a set of tiles in
JSON and can be found here: https:github.commapboxtilejson-spectreemaster2.1.0.
In essence, it provides a very simple encoding for describing the availability of a WMTS Simple profile layer in Web Mercator.
The minimum tileJSON file is:
{ tiles: [ http:tile.openstreetmap.org{z}{x}{y}.png ],
minzoom: 0, maxzoom: 18
}
One of the good thing of this encoding is that this JSON fragment can be ingested directly in web browser code. This is a code that generates a map browser for the San
Francisco area:
DOCTYPE html html
head meta charset=utf-8
titletitle script
src=https:api.tiles.mapbox.commapbox.jsv2.1.9mapbox.jss cript
link href=https:api.tiles.mapbox.commapbox.jsv2.1.9mapbox.css
rel=stylesheet style
body { margin:0; padding:0; } .map { position:absolute; top:0; bottom:0; width:100; }
style head
body div id=map class=map div
script
var tilejson = { tiles: [ http:tile.openstreetmap.org{z}{x}{y}.png ],
minzoom: 0, maxzoom: 18
}
L.mapbox.mapmap, tilejson
, { scrollWheelZoom: false
86
Copyright © 2015 Open Geospatial Consortium.
}.setView[37.82053680, -122.36481177], 11; script
body html
Recommendation 29: Consider to include tileJSON in a non normative example for the WMTS Simple profile.
Target: WMS.SWG
10.3.2 JSON encoding for a TileMatrixSet
One of the elements that makes singular the WMTS is capability to completely describe a tile matrix set. Being able to provide the description of a tile matrix set as in JSON could
simplify the way WMTS clients deal with tile space descriptions. In particular it could be useful to have a json description of the fixed tile matrix sets provided by the new WMTS
simple profile.
{ tileMatrixSet: [ {
id: wmtss:WorldWebMercatorQuad, type: wmts:TileMatrixSet,
title: Google Maps Compatible for the World, CRSbbox:
{ crs: http:www.opengis.netdefcrsEPSG03857,
lowerCorner: POINT-20037508.3427892, - 20037508.3427892,
upperCorner: POINT20037508.3427892, 20037508.3427892
}, crs: http:www.opengis.netdefcrsEPSG03857,
wellKnownScaleSet: http:www.opengis.netdefwkssOGC1.0GoogleMapsCompatible,
tileMatrix: [ { id: wmtss:WorldWebMercatorQuad0,
type: wmts:TileMatrix, scaleDenominator: 559082264.0287178,
topLeftCorner: POINT-20037508.3427892, 20037508.3427892,
tileWidth: 256, tileHeight: 256,
matrixWidth: 1, matrixHeight: 1
},{ id: wmtss:WorldWebMercatorQuad1,
type: wmts:TileMatrix, scaleDenominator: 279541132.0143589,