[MapProxy] WMTS service with multiple BBox

Thomas Polaert thomas.polaert at prysm.fr
Thu Jan 4 08:32:15 PST 2018


Hi,

I'm using a WMTS server as a source for a WMS service. 

The issue I have is that the WMTS service provides a slightly different
TopLeftCorner for each TileMatrix in the TileMatrixSet.
For ex:
TileMatrix #0        <TopLeftCorner>455642.960778
5478004.782551</TopLeftCorner>
TileMatrix #1        <TopLeftCorner>455642.960778
5488097.335224</TopLeftCorner>

As a result, WMS tiles are shifted up and down depending on the zoom level
(left corner is ok)

Can MapProxy handle grids where the bounding box changes for every zoom
level?  
Any advice are welcome.

Thanks,
Thomas

Here is a extract of the WMTS GetCapabilities :

<TileMatrixSet>
    <ows:Identifier>3857</ows:Identifier>
    <ows:BoundingBox crs="urn:ogc:def:crs:EPSG:6.3:3857">
        <ows:LowerCorner>455642.960778 5326616.492390</ows:LowerCorner>
        <ows:UpperCorner>676941.368957 5471417.006390</ows:UpperCorner>
    </ows:BoundingBox>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG:6.3:3857</ows:SupportedCRS>
    <TileMatrix>
        <ows:Identifier>0</ows:Identifier>
        <ScaleDenominator>352000.30264285713201388717</ScaleDenominator>
        <TopLeftCorner>455642.960778 5478004.782551</TopLeftCorner>
        <TileWidth>256</TileWidth>
        <TileHeight>256</TileHeight>
        <MatrixWidth>9</MatrixWidth>
        <MatrixHeight>6</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
        <ows:Identifier>1</ows:Identifier>
        <ScaleDenominator>281600.24210714286891743541</ScaleDenominator>
        <TopLeftCorner>455642.960778 5488097.335224</TopLeftCorner>
        <TileWidth>256</TileWidth>
        <TileHeight>256</TileHeight>
        <MatrixWidth>11</MatrixWidth>
        <MatrixHeight>8</MatrixHeight>
    </TileMatrix>
 [...]
    <TileMatrix>
        <ows:Identifier>11</ows:Identifier>
        <ScaleDenominator>1056.00090714285715876031</ScaleDenominator>
        <TopLeftCorner>455642.960778 5471419.391821</TopLeftCorner>
        <TileWidth>256</TileWidth>
        <TileHeight>256</TileHeight>
        <MatrixWidth>2924</MatrixWidth>
        <MatrixHeight>1913</MatrixHeight>
    </TileMatrix>
</TileMatrixSet>
</Contents>
</Capabilities>



Here is my MapProxy configuration:

services:
  demo:
  wms:
    srs: ['EPSG:4326']

layers:
  - name: my_layer
    title: WMS layer from WMTS
    sources: [my_cache]

caches:
  my_cache:
    grids: [my_grid]
    sources: [my_source]

sources:
  my_source:
    type: tile
    grid: my_grid
    url:
http://172.16.37.101/mapcache/wmts/?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0
.0&LAYER=osm_default&TILEMATRIXSET=3857&TILEMATRIX=%(z)s&TILEROW=%(y)s&TILEC
OL=%(x)s&FORMAT=image%%2Fpng
    coverage:
      bbox: [455642.960778, 5326616.492390, 676941.368957, 5471417.006390]
      srs: 'EPSG:3857'

grids:
  my_grid:
    origin: 'nw'
    bbox: [455642.960778, 5326616.492390, 676941.368957, 5471417.006390]
    srs: 'EPSG:3857'
    res: [
         #  res            level     scale @90.7 DPI
           98.5600847400, #  0      352000.30264286
           78.8480677900, #  1      281600.24210714
           59.1360508400, #  2      211200.18157143
           39.4240338900, #  3      140800.12103571
           29.5680254200, #  4      105600.09078571
           19.7120169500, #  5       70400.06053571
            9.8560084740, #  6       35200.03026429
            3.9424033890, #  7       14080.01210357
            2.7596823730, #  8        9856.00847500
            1.5769613560, #  9        5632.00484286
            0.7884806780, # 10        2816.00242143
            0.2956802540, # 11        1056.00090714
    ]




More information about the MapProxy mailing list