06-03-2016 03:36 PM
I have observed something interesting with Webmap WMTS recently.
Bascially I have a WMS source, I have created and configured a WMTS service that produces tiles off the WMS. The WMS covers a huge area and I only would like to have a subset of that on my WMTS, so I defined a bounding box in WMTS CacheConfiguration.xml file. I then loaded the WMTS in Admin Portal. The issue now is as I zoom in and zoom out the extent of the WMTS keeps changing e.g. when zoomed out, whatever is defined in the bounding box would display completely; when zoomed in, a large portion of the WMTS is "chopped out", see screenshots below:
Screenshot1 : @1:272989 map scale - this one shows the full extent of the WMTS as defined by the bounding box
Screenshot2: now zoomed in @ 1:136495 - You can see the top half of the original extent has been chopped out.
Screenshot3: zoomed in a bit more @ 1:68247 - you can see only a small portion of the original extent is left and displayed on the screen.
After I observed this funny behavior I thought it must have something to do with the bounding box I set up in CacheConfiguration.xml file. So I went to the original WMS, copied the WMS bounding box and pasted in the WMTS CacheConfiguration.xml file. Everything started working properly afterwards.
So I am assuming that the bounding box you set in CacheConfiguration.xml is not being respected by Geospatial Portal.
Anyone has observed the same thing before?
p.s. I am on webmap15 ep05
06-03-2016 02:27 AM
That's most probably caused by the fact that the WMTS is serving statically dimensioned, discrete tiles from a statically defined grid. On each level, the bounding box provided in the configuration is used to determine the tile extents for that level. Each tile that touches the bounding box makes it into the tilematrix. Most probably, the extents of the lowest zoom level (largest scale denominator) of the tiles displayed is larger than the bounding box you provided. The deeper you go, the tiles get smaller and it's easier to approximate the bounding box.
Let me break out my MS Paint skills to get a picture:
The greyed areas are the tiles that are being filled/served. The red dashed rectangle is the bounding box.
06-06-2016 02:56 PM
What you have described makes sense.
What would be a feasible solution to this issue? I realize that in CacheConfiguration.xml file you can change the tilesize. I changed from 256 down to 50 which makes the tiles size 1/5 of the original, and I still obseve the same behaviour.
06-07-2016 03:48 AM
The only sensible solution would be to align the bounding box with the tile grid from the level you start displaying. Furthermore, the subsequent levels' tileSize needs to be adjusted so that tiles from level X contain a whole number of tiles from level X+1 (e.g. 80, 40, 20, 10; or 90, 30, 10; but not 80, 70, 60, 50). The tile grid is aligned with the CRS origin (0,0).
For example, say you have your tiles defined to start from level 3 and a tileSize of 80:
level 3, tileSize 80
level 4, tileSize 40
level 5, tileSize 20
Your desired bounding box is 20, -110, 60, 20. On level 3, the tiles are both horizontally and vertically placed so that their borders run over -160, -80, 0, 80, 160. The adjusted bounding box would then be 0, -160, 80, 80.
Your mileage may vary, and you might be forced to define different level sizes/starting level.