1

This is a followup question to this one:

Access WMTS from a GeoTIFF Layer in GeoServer

I'm pursuing approach 1:

Request the GeoServer layer as a WMTS tile set via GeoWebCache (which is built into your GeoServer install) - MapProxy should be able to combine two WMTS layers.

The problem is, I can't get it done. The information found at https://www.geowebcache.org/docs/current/services/wmts.html seems to be largely outdated. I've tried to puzzle the url together myself, alas to no avail.

For reference, the layer in Geoserver is called bel_geo.

Here's my currently nonworking mapproxy configuration:

services:
  demo:
  tms:
    use_grid_names: true
    origin: 'nw'
  kml:
      use_grid_names: true
  wmts:
  wms:
    md:
      title: MapProxy WMS Proxy
      abstract: MapProxy Configuration for BEL

layers:
  - name: combined_layer
    title: geotiff + osm
    sources: [osm_cache, geotiff_cache]
  - name: bel_mapnik
    title: TMS layer from tiles
    sources: [osm_cache]
  - name: bel_geo
    sources: [geotiff_cache]
    title: bel_geo

caches:
  osm_cache:
    grids: [osm_grid]
    sources: [osm_tiles]
    format: image/png
  geotiff_cache: 
    grids: [osm_grid]
    sources: [bel_geo_wmts]
    format: image/png   

sources:
   osm_tiles:
     grid: GLOBAL_WEBMERCATOR
     type: tile
     transparent: true
     url: http://10.77.70.19/osm_tiles/%(z)s/%(x)s/%(y)s.png
   bel_geo_wmts:
      coverage:
         bbox: [83.25852589091137, 17.64976906844559, 83.38175007681757, 17.728854817689484]
         srs: EPSG:4326
      url: http://10.77.70.19:8080/geoserver/gwc/service/wmts/rest/bel:bel_geo/EPSG:4326/EPSG:4326:%(z)s/%(x)s/%(y)s.png
      type: tile

grids:
    osm_grid:
        srs: EPSG:900913
        origin: nw

globals:

The mapnik layer works just fine, but I'm not getting anywhere with the geotiff.

1

If you are using the internal GeoWebcache then you simply need the WMTS capabilities document which is linked from the front page of GeoServer.

enter image description here

Inside that document you will find the templates you need as ResourceURLs:

<ResourceURL format="image/png" resourceType="tile" template="http://localhost:8080/geoserver/gwc/service/wmts/rest/nurc:Pk50095/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/png"/>
<ResourceURL format="image/jpeg" resourceType="tile" template="http://localhost:8080/geoserver/gwc/service/wmts/rest/nurc:Pk50095/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/jpeg"/>

Pick the one that suits your needs and paste that into mapproxy.

Even easier might just be to point MapProxy at the WMS endpoint and let it make it's own tiles.

  • Thank you, Ian. How would I go about letting MapProxy make its own tiles? That's what I tried first, but failed miserably. Could you show how the config is supposed to look like? Also, as for the templates, what am I supposed to enter for TileMatrix etc? Sorry for being so inept, but I'm really green in regards to thise whole map stuff. – Fang Jul 4 '19 at 15:38

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.