GeoServer WMTS – Is it Possible to Do a GetFeatureInfo Request using WMTS?

geoservergetfeatureinfoopenlayersrestwmts

I currently have an interactive map with multiple layers based on the WMS protocol, which has been working fairly well. I use GeoServer to serve the layers and OpenLayers for the front-end. My problem has been that the tiles have been loading very slowly for large data-sets. I decided to use GWC, which is built into GeoServer, to seed the tiles to improve performance. All my layers are in EPSG:27700 and it turns out this CRS does not play nicely with GWC as I found out in my previous question, How to use geowebcache seeded tiles with a custom projection (EPSG: 27700) in openlayers.

I decided to use WMTS, which has solved the problem I was having in the previous question, however I have noticed that there is no GetFeatureInfo call with WMTS as with WMS. I have found some mention of using the WMTS REST API to get feature information, however I am having a lot of trouble finding a good example of how this is done.

Does anyone know of a good resource or have a code example to help with my problem?

Best Answer

Is it possible to do a GetFeatureInfo request using WMTS?

It depends on what is supported by your service implementation, but in theory it is possible, by which I mean the OpenGISĀ® Web Map Tile Service Implementation Standard (OGC 07-057r7) defines such an operation:

7.3.2 GetFeatureInfo operation (optional in procedure oriented architectural style)

The GetFeatureInfo operation in procedure oriented architectural style allows WMTS clients to request information at a particular position of a particular tile for a particular queryable layer. A layer is queryable if the Contents section of the ServiceMetadata document specifies one or more InfoFormats for this layer.

NOTE 1 This criterion is different from the one used in WMS. In WMTS, the queryable property of WMS has been substituted by the presence or absence of an InfoFormat element in the ServiceMetadata document.

The GetFeatureInfo operation is designed to provide clients of a WMTS with more information about features rendered in a previously returned tile. The canonical use case for GetFeatureInfo is that a user chooses a pixel (I,J) on a particular tile at which the user would like to obtain more information. Because the WMTS protocol is stateless, the GetFeatureInfo request indicates to the WMTS server what tile the user is viewing by including the original GetTile request parameters but modifying the request value to 'GetFeatureInfo' and adding the pixel offset parameters. From the spatial context information (TileRow, TileCol and TileMatrixSet), along with the I,J position the user requested, the WMTS can return additional information about that position. The other GetTile parameters (e.g., Style) may play a role in the server's decision as to what information to return.

etc.

If your server only supports the OGC Web Map Tile Service (WMTS) Simple Profile (13-082r2) then I think there is no operation defined.

Refs:

OGC Web Map Tile Service (WMTS) Simple Profile

OpenGIS Web Map Tile Service Implementation Standard

Related Question