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:
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?
I have also tried to call the service’s getTile operation directly (using Postman) for the 3006 TileMatrix and that also worked as expected.
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.
I have the same issue with this service also: https://tiles.maaamet.ee/tm/wmts?service=WMTS&version=1.0.0&request=GetCapabilities
Native SRS is set to "EPSG:4326" although it is not supported by the WMTS service.
Following rows in log: