3

I am trying to consume Lantmateriet's WMTS source with EPSG:3006 and convert that to iOS TileOverlay compatible (GoogleMaps compatible) tile server. I cannot get it working. Can someone check this out and say what I am doing wrong.

mapproxy.yaml:

services:
  tms:
    use_grid_names: false
    origin: 'nw'
layers:
  - name: sweden
    title: sweden
    sources: [cache_sweden]
    tile_sources: [cache_sweden]

caches:
  cache_sweden:
    sources: [cache_sweden_original]
    grids: [GLOBAL_MERCATOR]
    meta_size: [4, 4]
    cache:
      type: mbtiles
  cache_sweden_original:
    sources: [source_sweden]
    grids: [grid_sweden]
    disable_storage: true
sources:
  source_sweden:
    type: tile
    grid: grid_sweden   
    url: 'https://api.lantmateriet.se/open/topowebb-ccby/v1/wmts/token/mytoken/?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=topowebb&STYLE=default&TILEMATRIXSET=3006&TILEMATRIX=%(z)s&TILEROW=%(y)s&TILECOL=%(x)s&FORMAT=image/png'
grids:
  grid_sweden:
    srs: 'EPSG:3006'
    bbox: [-1200000.000000, 4305696.000000, 2994304.000000, 8500000.000000]
    origin: nw

This is what it looks now: This is what it looks now

Capabilities of the WMTS source I am trying to use can be seen: GetCapabilities.xml

  • Could you share the final grid definition, please? I am in the same situation.. – Tore Halset Aug 17 '16 at 18:02
  • @ToreHalset I added final grid definition to the answer – mikkokut Aug 18 '16 at 4:16
  • 1
    This topic helps me a lot. Thanks. MapProxy is awesome to do WMS/WMTS reprojection (e.g. EPSG:3006 to EPSG:3857). I suggest to enable the caching for "cache_sweden_original", because you need some common 'EPSG:3006 tiles' to build the 'EPSG:3857 tiles'. I also fixed the URL and added some resolution scales up to 13 as the GetCapabilities provides. <pre>services: demo: tms: use_grid_names: false origin: 'nw' layers: - name: sweden title: sweden sources: [cache_sweden] tile_sources: [cache_sweden] caches: cache_sweden: sources: [cache_sweden_original] grids: [GLOBAL_WEBMERCATOR] cache: type: fil – user82487 Sep 13 '16 at 11:30
2

The problem was with the res-parameter. I had to calculate the scales based on the GetCapabilities. Here is a good guide how to do it properly https://lists.osgeo.org/pipermail/mapproxy/2013-August/001674.html

The final grid definition was

grid_sweden_3006:
   srs: 'EPSG:3006'
   bbox: [-1200000, 4305696, 2994304, 8500000]
   origin: nw
   res: [
     #  res            level     scale @90.7 DPI
     4096.0000000000, #  0    14628571.42857143
     2048.0000000000, #  1     7314285.71428571
     1024.0000000000, #  2     3657142.85714286
      512.0000000000, #  3     1828571.42857143
      256.0000000000, #  4      914285.71428571
      128.0000000000, #  5      457142.85714286
       64.0000000000, #  6      228571.42857143
       32.0000000000, #  7      114285.71428571
       16.0000000000, #  8       57142.85714286
        8.0000000000, #  9       28571.42857143
   ]                  # the end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.