[MapProxy] Problems with WMTS grid configuration

Matthias Woltering woltering at gmail.com
Mon Jun 3 08:44:15 PDT 2019


Hi all,

I have problems creating the correct mapproxy-grid. Maybe someone can 
help me?!


source (getCapabilities):
=========================

<https://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS?>

<?xml version="1.0" encoding="UTF-8"?>
<Capabilities xmlns="http://www.opengis.net/wmts/1.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml"
xsi:schemaLocation="http://www.opengis.net/wmts/1.0 
http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd"
version="1.0.0">
<!-- Service Identification --> <ows:ServiceIdentification>
<ows:Title>RIPS_TK_Cache</ows:Title>
<ows:ServiceType>OGC WMTS</ows:ServiceType>
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
</ows:ServiceIdentification> <!-- Operations Metadata --> 
<ows:OperationsMetadata>
<ows:Operation name="GetCapabilities">
<ows:DCP>
<ows:HTTP>
<ows:Get 
xlink:href="http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/1.0.0/WMTSCapabilities.xml">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<!-- add KVP binding in 10.1 -->
<ows:Get 
xlink:href="http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS?">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>KVP</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
<ows:Operation name="GetTile">
<ows:DCP>
<ows:HTTP>
<ows:Get 
xlink:href="http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/tile/1.0.0/">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get 
xlink:href="http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS?">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>KVP</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
</ows:OperationsMetadata> <Contents>
<!--Layer--> <Layer>
<ows:Title>RIPS_TK_Cache</ows:Title> 
<ows:Identifier>RIPS_TK_Cache</ows:Identifier>
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
<ows:LowerCorner>250000.00000000093 5200000.000000004</ows:LowerCorner>
<ows:UpperCorner>749999.9999999991 5600000.000000004</ows:UpperCorner>
</ows:BoundingBox> <ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>5.474640224093635 46.90644116046651</ows:LowerCorner>
<ows:UpperCorner>12.525359775906365 50.55193238381328</ows:UpperCorner>
</ows:WGS84BoundingBox>
<Style isDefault="true">
<ows:Title>Default Style</ows:Title>
<ows:Identifier>default</ows:Identifier>
</Style>
<Format>image/png</Format>
<TileMatrixSetLink>
<TileMatrixSet>default028mm</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/png" resourceType="tile" 
template="http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/tile/1.0.0/RIPS_TK_Cache/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" 
/>
</Layer> <!--TileMatrixSet-->
<TileMatrixSet>
<ows:Title>TileMatrix using 0.28mm</ows:Title>
<ows:Abstract>The tile matrix set that has scale values calculated based 
on the dpi defined by OGC specification (dpi assumes 0.28mm as the 
physical distance of a pixel).</ows:Abstract> 
<ows:Identifier>default028mm</ows:Identifier>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG::25832</ows:SupportedCRS>
<TileMatrix>
<ows:Identifier>0</ows:Identifier>
<ScaleDenominator>472471.18303754483</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>174</MatrixWidth> <MatrixHeight>142</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>1</ows:Identifier>
<ScaleDenominator>188988.4732150179</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>434</MatrixWidth> <MatrixHeight>355</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>2</ows:Identifier>
<ScaleDenominator>94494.23660750895</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>867</MatrixWidth> <MatrixHeight>709</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>3</ows:Identifier>
<ScaleDenominator>47247.118303754476</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>1734</MatrixWidth> <MatrixHeight>1417</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>4</ows:Identifier>
<ScaleDenominator>23623.559151877238</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>3468</MatrixWidth> <MatrixHeight>2834</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>5</ows:Identifier>
<ScaleDenominator>11811.779575938619</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>6935</MatrixWidth> <MatrixHeight>5668</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>6</ows:Identifier>
<ScaleDenominator>6142.125379488082</ScaleDenominator>
<TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> 
<TileWidth>256</TileWidth> <TileHeight>256</TileHeight>
<MatrixWidth>13335</MatrixWidth> <MatrixHeight>10899</MatrixHeight>
</TileMatrix>
</TileMatrixSet>
</Contents>
<ServiceMetadataURL 
xlink:href="http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/1.0.0/WMTSCapabilities.xml" 
/> </Capabilities>

parts of mapproxy-configuration:
================================

layers:
     - name: topo
       title: topographische karte
       sources: [cache_topo]


caches:
     cache_topo:
         grids: [rips_grid]
         sources: [source_topo]
         format: image/png
         request_format: image/png

source_topo:
     type: tile
     grid: rips_grid
     url: 
https://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/tile/1.0.0/RIPS_TK_Cache/default/default028mm/%(z)s/%(x)s/%(y)s.png
     coverage:
       bbox: [5.474640224093635, 46.90644116046651, 12.525359775906365, 
50.55193238381328]
       bbox_srs: 'EPSG:4326'



rips_grid:
     origin: 'nw'
     bbox: [5.474640224093635, 46.90644116046651, 12.525359775906365, 
50.55193238381328]
     bbox_srs: 'EPSG:4326'
     srs: 'EPSG:25832'

     # mapproxy-util scales --as-res-config 472471.18303754 
188988.47321502 94494.23660751 47247.11830375 23623.55915188 
11811.77957594 6142.12537949
     res: [
         #  res            level     scale @90.7 DPI
         132.2919312505, #  0      472471.18303754
          52.9167725002, #  1      188988.47321502
          26.4583862501, #  2       94494.23660751
          13.2291931250, #  3       47247.11830375
           6.6145965625, #  4       23623.55915188
           3.3072982813, #  5       11811.77957594
           1.7197951063, #  6        6142.12537949
         ]


Problems:
=========

1. check wmts via qgis (see url above): map is visible. At zoom 0 the 
urls of tiles with maps have a range between
TileCol [160..171]
TileRow [131..140]
see for example (Pforzheim):
<http://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/tile/1.0.0/RIPS_TK_Cache/default/default028mm/0/135/165.png> 


2. if I check the wmts in mapproxy-demo, no map is visible. Following 
errors are seen:

[2019-06-03 17:35:53,563] mapproxy.source.request - INFO - GET 
https://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/tile/1.0.0/RIPS_TK_Cache/default/default028mm/0/10/4.png 
404 - 151
[2019-06-03 17:35:53,563] mapproxy.source.tile - WARNING - could not 
retrieve tile: HTTP Error 
"https://rips-caches.lubw.baden-wuerttemberg.de/arcgis/rest/services/RIPS_TK_Cache/MapServer/WMTS/tile/1.0.0/RIPS_TK_Cache/default/default028mm/0/10/4.png": 
404

At zoom 0 the urls of tiles with maps have a range between
TileCol [4..7]
TileRow [6..10]

Do I have to set an offset? (Is this possible?) I tried to use the bbox 
in utm32-coordinates. No effect.

Thanks in advance!




More information about the MapProxy mailing list