Cant get WebMapTileServiceImageryProvider to work with WebMercatorTilingScheme

823 views
Skip to first unread message

Poul Sørensen

unread,
Aug 26, 2015, 6:19:34 AM8/26/15
to cesium-dev


var test = new Cesium.WebMapTileServiceImageryProvider({
                url
: "http://kortforsyningen.kms.dk/orto_foraar?service=WMTS&request=GetTile&version=1.0.0&layer=orto_foraar&style={Style}&tilematrixset={TileMatrixSet}&tilematrix={TileMatrix}&tilerow={TileRow}&tilecol={TileCol}&login=&password=&format=image/jpeg",
                layer
: "orto_foraar",
                style
: "default",
                tileMatrixSetID
: "View1",
                tileMatrixLabels
: ["L00", "L01", "L02", "L03", "L04", "L05", "L06", "L07", "L08", "L09", "L10", "L11", "L12", "L13"],
                format
: "image/jpg",
                rectangle
: Cesium.Rectangle.fromDegrees(3.32016, 53.113655, 17.55777, 58.35397),
                tilingScheme
: new Cesium.WebMercatorTilingScheme({
                    rectangleSouthwestInMeters
: new Cesium.Cartesian2(120000, 5900000),
                    rectangleNortheastInMeters
: new Cesium.Cartesian2(1000000, 6500000),
                    numberOfLevelZeroTilesX
: 3,
                    numberOfLevelZeroTilesY
:2,
               
})
           
});
           
this.viewer.imageryLayers.addImageryProvider(test);

i removed the credentials for the url, but cesium fails before it start loading tiles.  

Cesium.js?bust=v267115-594:460 
Uncaught TypeError: Cannot read property 'x' of undefined

the 1.12 minified file.

Is the configuration correct above or am i missing something. If its correct I can try debug some more.

Poul Sørensen

unread,
Aug 26, 2015, 6:33:37 AM8/26/15
to cesium-dev
I got this when using the unminifized version, 

Uncaught DeveloperError: The imagery provider's rectangle and minimumLevel indicate that there are 6 tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.
Error

I got those from the http://kortforsyningen.kms.dk/orto_foraar?request=GetCapabilities&service=WMTS&version=1.0.0  document, but I guess I can recalculate some bounds to make it fit the tiling schema and make it work. will give it a try

Poul Sørensen

unread,
Aug 26, 2015, 6:35:11 AM8/26/15
to cesium-dev
doh, nvm, i am mixing up the documents and reading from the wrong projection file.

Coordinates are wrong.

Poul Sørensen

unread,
Aug 26, 2015, 8:26:09 AM8/26/15
to cesium-dev
So, back with a reprojected layer in the right projection.  http://ascend-xyz-maps-odin-weu.cloudapp.net/mapproxy/ascend-kortforsyningen/wmts/1.0.0/WMTSCapabilities.xml

I am unsure how I get past the https://github.com/AnalyticalGraphicsInc/cesium/blob/1.12/Source/Scene/WebMapTileServiceImageryProvider.js#L135 requirement when the first layer in my wtms is actually of 7 by 14 tiles as seen in the gapabilities document:

<TileMatrix>
<ows:Identifier>00</ows:Identifier>
<ScaleDenominator>5851428.57143</ScaleDenominator>
<TopLeftCorner>-1878007.03 9436480.79</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>7</MatrixWidth>
<MatrixHeight>14</MatrixHeight>
</TileMatrix>

Poul Sørensen

unread,
Aug 26, 2015, 9:21:12 AM8/26/15
to cesium-dev
I found another of our wmts that has been configured more appropriated and got it working :

Poul Sørensen

unread,
Aug 26, 2015, 9:22:43 AM8/26/15
to cesium-dev
The configuration trick was to make sure that the WMTS has layers all the way to its lvl 0 of the tiling schema.
and use rectangle to limit where it should request tiles.

var test = new Cesium.WebMapTileServiceImageryProvider({
                layer: "VDOrtho2014AprilWebMercator",
                style: "default",
                tileMatrixSetID: "GLOBAL_WEBMERCATOR",
                tileMatrixLabels: ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"],
                format: "image/jpg",
                rectangle: Cesium.Rectangle.fromDegrees(11.25, 55.5791209568, 12.0327758789, 56.0310189643), //Cesium.Rectangle.fromDegrees(3.32016, 53.113655, 17.55777, 58.35397),
            
            });
Reply all
Reply to author
Forward
0 new messages