[MapProxy] Problems creating WMS from existing Tile Server

Thomas Konrad tkonrad at gmx.net
Tue Jun 10 09:41:37 PDT 2014


Hello,

first of all: Thanks for creating MapProxy and for making it so well-documented and Open Source!

I’m currently trying to create a WMS service out of a WMTS tile service (so I need a conversion between the two formats) and I’m having trouble with it. The source is the ViennaGIS multi-porpose map (https://www.wien.gv.at/stadtplan/). The capabilities document is here: http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml. I followed the instructions at http://lists.osgeo.org/pipermail/mapproxy/2013-August/001674.html to calculate the right scale factors and generally followed http://mapproxy.org/docs/nightly/configuration_examples.html#create-wms-from-existing-tile-server for the basic configuration (by the way, I’m using the 1.7.0a nightly build).

Here’s the configuration I came up with (mapproxy.yaml):

##########################################

services:
  demo:
  wms:
    md:
      title: ViennaGIS Multi-Porpose WMS Server

layers:
  - name: vienna_gis
    title: ViennaGIS Multi-Purpose Map (WMS layer)
    sources: [vienna_cache]

caches:
  vienna_cache:
    grids: [vienna_grid] # GLOBAL_WEBMERCATOR? -> Gives "BBOX does not align to tile"
    sources: [vienna_source]

sources:
  vienna_source:
    type: tile
    grid: vienna_grid
    url: http://www.wien.gv.at/wmts/fmzk/pastell/google3857/%(z)s/%(y)s/%(x)s.jpeg

grids:
  vienna_grid:
    srs: 'EPSG:3857'
    origin: 'nw'
    bbox: [1799448.394855, 6124949.747770, 1848250.442089, 6162571.828177] # Is that the right SRS? How do I know?
    res: [
         #  res            level     scale @90.7 DPI
       156543.0339281200, #  0   559082264.02900004
        78271.5169642000, #  1   279541132.01499999
        39135.7584819600, #  2   139770566.00700000
        19567.8792410080, #  3    69885283.00360000
         9783.9396205040, #  4    34942641.50180000
         4891.9698102520, #  5    17471320.75090000
         2445.9849051260, #  6     8735660.37545000
         1222.9924525644, #  7     4367830.18773000
          611.4962262808, #  8     2183915.09386000
          305.7481131404, #  9     1091957.54693000
          152.8740565705, # 10      545978.77346600
           76.4370282852, # 11      272989.38673300
           38.2185141425, # 12      136494.69336600
           19.1092570713, # 13       68247.34668320
            9.5546285356, # 14       34123.67334160
            4.7773142678, # 15       17061.83667080
            2.3886571339, # 16        8530.91833540
            1.1943285670, # 17        4265.45916770
            0.5971642835, # 18        2132.72958385
            0.2985821417, # 19        1066.36479193
    ]
    tile_size: [256, 256] # That sould be default anyway

##########################################

When I start the server and try to open the demo page for the newly created WMS service, it tells me:

    Could not get any sources:
    HTTP Error „http://www.wien.gv.at/wmts/fmzk/pastell/google3857/11/0/1.jpeg“: 404

So we’re seemingly somehow outside of the bounding box. When I intercept the traffic of JOSM for example, I see way higher numbers for the X and Y values. So I guess the tile index calculation is wrong in some way. The ViennaGIS WMTS service is also pre-configured in JOSM for if you want to try it out there (Vienna: Mehrzweckkarte (general purpose) - tms[19]:http://www.wien.gv.at/wmts/fmzk/pastell/google3857/{zoom}/{y}/{x}.jpeg).

First I thought that the demo uses a random bounding box for the WMS service and therefore does not find the tiles, but then I saw in the JavaScript source code that it does center the map view correctly according to the bounding box I defined.

Some questions that came to my mind while configuring MapProxy:
 - How can I determine which bounding box SRS I should use? In the capabilities document above, the box is given as very high numbers, whereas in other configuration examples i saw the box defined in degrees.
 - Can I use two different grids for the service and the source? Does the conversion work in all cases? When I use GLOBAL_WEBMERCATOR as a grid for the „cache“ section, the demo says „Could not get any sources: BBOX does not align to tile.“
 - If a tile map service is limited to a bounding box, do the tiles usually start with 0/0 or with the generic index of that place?

I’m kind of stuck here. Is anyone so nice as to point me towards the right direction?

Thanks in advance
Thomas


More information about the MapProxy mailing list