Creation of a WebMapTile ServiceImageryProvider using a WMTS layer with a custom TilingScheme based on an existing EPSG code (EPSG:2056)

Hi,

Cesium JS currently allows for those two WMTS tiling schemes:

and that’s really great.

But I’d like to integrate some WMTS layer (using WebMapTileServiceImageryProvider) from this WMTS for which the only available TileMatrixSet is based on EPSG:2056 as follow:

<TileMatrixSet>
<ows:Identifier>ktzh</ows:Identifier>
<ows:SupportedCRS>EPSG:2056</ows:SupportedCRS>
<TileMatrix>
<ows:Identifier>00</ows:Identifier>
<ScaleDenominator>241904.76190464283</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>11</MatrixWidth>
<MatrixHeight>8</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>01</ows:Identifier>
<ScaleDenominator>120952.38095249998</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>22</MatrixWidth>
<MatrixHeight>15</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>02</ows:Identifier>
<ScaleDenominator>60476.19047607142</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>43</MatrixWidth>
<MatrixHeight>30</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>03</ows:Identifier>
<ScaleDenominator>30238.095238214282</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>85</MatrixWidth>
<MatrixHeight>59</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>04</ows:Identifier>
<ScaleDenominator>15119.04761892857</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>170</MatrixWidth>
<MatrixHeight>118</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>05</ows:Identifier>
<ScaleDenominator>7559.523809642857</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>339</MatrixWidth>
<MatrixHeight>235</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>06</ows:Identifier>
<ScaleDenominator>3779.7619046428567</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>677</MatrixWidth>
<MatrixHeight>469</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>07</ows:Identifier>
<ScaleDenominator>1889.8809525</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>1354</MatrixWidth>
<MatrixHeight>937</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>08</ows:Identifier>
<ScaleDenominator>944.9404760714285</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>2707</MatrixWidth>
<MatrixHeight>1874</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>09</ows:Identifier>
<ScaleDenominator>472.4702382142857</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>5413</MatrixWidth>
<MatrixHeight>3748</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>10</ows:Identifier>
<ScaleDenominator>236.2351189285714</ScaleDenominator>
<TopLeftCorner>2480237.0 1315832.0</TopLeftCorner>
<TileWidth>512</TileWidth>
<TileHeight>512</TileHeight>
<MatrixWidth>10825</MatrixWidth>
<MatrixHeight>7495</MatrixHeight>
</TileMatrix>
</TileMatrixSet>

What would be the most efficient / cleaner way to achieve this?

Note: I am neither the owner nor do I have access to this WMTS server.

Also, I’m not sure it’s worth opening a feature request, but I would love Cesium to let users import custom WMTS layers in any given CRS based on EPSG codes.

ps: the word “WebMapTileServiceImageryProvider” was too long for the title, I had to insert a space to split it.

Thanks.

Ah, right now you’ll need to convert the imagery to a CRS similar to either Geographic or WebMercator. Support for additional projections is a popular feature request. I’ll add your comment to that thread. Thanks for bringing it up!