TileMatrixSets' supported CRS are ignored when consuming WMTS service

Description

When creating a WMTS store and publishing layers from that store, Geoserver seems to ignore the supported CRS's set in the TileMatrixSets and always thinks the native SRS is WGS84 (4326). I have tried the following WMTS services:

http://geodata.nationaalgeoregister.nl/luchtfoto/infrarood/wmts?request=GetCapabilities&service=WMTS
http://wmts.kartetirol.at/wmts
https://api.lantmateriet.se/open/topowebb-ccby/v1/wmts/token/8d61b10d-e93b-3c04-b4ae-4f4bdd1afe1b/?request=getcapabilities&service=wmts

In my case I need to use the last of the three services (api.lantmateriet.se) and publish a SWEREF99 (3006) layer. The service provides one TileMatrixSet supporting WGS84/Pseudo-mercator (3857) and one supporting SWEREF99 (3006). Trying to reproject to or force the use of the declared SWEREF99 creates a broken map with overlapping tiles (this somehow works for 3857 though).

A couple of things worth noting:

  • When I press the publish/publish again links for the store, the geoserver log says “Skipping WGS 84 / Pseudo-Mercator definition, it was not recognized by the referencing subsystem” and “Skipping SWEREF99 TM definition, it was not recognized by the referencing subsystem”. That seems relevant but I don’t know what it means. Other systems can consume the service as described below.

  • Opening the WMTS connection from QGIS 3.4.2 results in a tree structure with the two layers at the top and under them the two tile matrices (named 3006 and 3857 after the supported SRS’es). When adding one of the layers’ 3006 TileMatrix, the map displays perfectly. In Geoserver, shouldn't you get to choose which TileMatrixSet to use like in QGIS?

The tokens in the URL's will get invalidated after a while but the data is open so anyone can create an account at https://opendata.lantmateriet.se and generate their own.

Environment

None

Status

Assignee

Ian Turton

Reporter

Henrik Pierrou

Triage

None

Fix versions

None

Affects versions

Components

Priority

High
Configure