1

I am trying to consume city of Paris WMTS source with EPSG:2154 and convert that to iD compatible (OpenStreetMap compatible) tile server (WMS or TMS).

The map is visible here et here is an example of tile.

I cannot get it working. I have already followed this guide https://lists.osgeo.org/pipermail/mapproxy/2013-August/001674.html

Can someone check this out and say what I am doing wrong.

The WMTS GetCapacibilities is available here.

mapproxy.yaml:

services:
  tms:
  wmts:
  wms:
  demo:

layers:
  - name: planches_igc2
    title: Plan de l'Inspection Générale des Carrières de la ville de Paris
    sources: [planches_igc2]


caches:
  planches_igc2:
    grids: [utm32n] 
    sources: [planches_igc_wmts]


sources:
  planches_igc_wmts:
    type: tile
    url: https://capgeo2.paris.fr/public/rest/services/IGC/IGC_Atlas_carrieres_image/MapServer/WMTS/tile/1.0.0/IGC_IGC_Atlas_carrieres_image/default/default028mm/%(z)s/%(x)s/%(y)s.png
    grid: utm32n

grids:
    webmercator:
        base: GLOBAL_WEBMERCATOR
    utm32n:
      origin: 'nw'
      srs: 'EPSG:2154'
      bbox_srs: 'EPSG:2154'
      tile_size: [256,256]
      bbox: "637827.9419,6849420.6548000015,670590.5560000017, 6874797.487399999"
      res: [
           #  res            level     scale @90.7 DPI
            305.7480111760, #  0     1091957.18277137
            152.8740055880, #  1      545978.59138569
             76.4370027940, #  2      272989.29569284
             38.2185013970, #  3      136494.64784642
             19.1092506985, #  4       68247.32392321
              9.5546253492, #  5       34123.66196161
              4.7773126746, #  6       17061.83098080
              2.3886563373, #  7        8530.91549040
              1.1943281687, #  8        4265.45774520
              0.5971640843, #  9        2132.72887260
              0.2985820422, # 10        1066.36443630
              0.1492910211, # 11         533.18221815
              0.0746455105, # 12         266.59110908
      ]
  



globals:
1
  • Your source URL is definitely wrong, you need to replace x,y to %(y)s/%(x)s. Do you have the original Link to the WebMap system, where the layer is available? I cannot find the layer in capgeo.sig.paris.fr/Apps/ParisPLU. My guess is that the service needs an additional HTTP Referrer Header. For testing purpose, you need to fetch one image with CURL without HTTP referrer header.
    – christoph
    Commented May 5 at 9:45

1 Answer 1

0

It looks like the WMTS service is disabled for this ArcGIS layer, but there is always a plan "B". You can use the ArcGIS Rest Export operation instead (https://developers.arcgis.com/rest/services-reference/enterprise/export-map.htm). There is no need to add a HTTP referrer header as I suggested in the comment.

enter image description here

And here's the complete MapProxy service configuration file (paris.yaml):

services:
  demo:
  kml:
  tms:
    # needs no arguments
  wmts:
    restful: true
    restful_template:
        '/{Layer}/{TileMatrixSet}/tile/{TileMatrix}/{TileRow}/{TileCol}'
  wms:
    srs: ['EPSG:3857','EPSG:2154']
    bbox_srs: ['EPSG:3857','EPSG:2154']
    image_formats: ['image/png; mode=24bit', 'image/jpeg', 'image/png','image/tiff']
    max_output_pixels: [1000000,1000000]

    #md:
      # metadata used in capabilities documents
      #title: MapProxy WMS Proxy

layers:
  - name: planches_igc2
    title: Plan de l'Inspection Générale des Carrières de la ville de Paris
    sources: [planches_igc2]


caches:
  planches_igc2:
    grids: [webmercator] 
    sources: [planches_igc_wmts]
    format: image/png
    #link_single_color_images: true
    #cache:
    #  type: geopackage
    #  filename: planches_igc.gpkg
    #  table_name: planches_igc_tiles

sources:
  planches_igc_wmts:
    type: tile
    url: https://capgeo2.paris.fr/public/rest/services/IGC/IGC_Atlas_carrieres_image/MapServer/export?bbox=%(bbox)s&bboxSR=3857&size=256,256&imageSR=3857&format=png&dpi=96&transparent=true&f=image
    #url: https://capgeo2.paris.fr/public/rest/services/IGC/IGC_Atlas_carrieres_image/MapServer/export?bbox=%(bbox)s&bboxSR=2154&size=256,256&imageSR=2154&format=png&dpi=96&transparent=true&f=image
    #url: https://capgeo2.paris.fr/public/rest/services/IGC/IGC_Atlas_carrieres_image/MapServer/WMTS/tile/1.0.0/IGC_IGC_Atlas_carrieres_image/default/default028mm/%(z)s/%(y)s/%(x)s.png
    grid: webmercator
    transparent: true
    on_error:
      204:
        response: transparent
        cache: False
      other:
        response: transparent
        cache: False
        
grids:
    webmercator:
        base: GLOBAL_WEBMERCATOR
        res: [305.748113140558,152.874056570411,76.4370282850732,38.2185141425366,19.1092570712683,9.55462853563415,4.77731426794937,2.38865713397468,1.19432856685505]
    
    utm32n:
      origin: 'nw'
      srs: 'EPSG:2154'
      bbox: [637827.9419,6849420.6548000015,670590.5560000017, 6874797.487399999]
      bbox_srs: 'EPSG:2154'
      tile_size: [256,256]
      res: [
           #  res            level     scale @90.7 DPI
            305.7480111760, #  0     1091957.18277137
            152.8740055880, #  1      545978.59138569
             76.4370027940, #  2      272989.29569284
             38.2185013970, #  3      136494.64784642
             19.1092506985, #  4       68247.32392321
              9.5546253492, #  5       34123.66196161
              4.7773126746, #  6       17061.83098080
              2.3886563373, #  7        8530.91549040
              1.1943281687, #  8        4265.45774520
              0.5971640843, #  9        2132.72887260
              0.2985820422, # 10        1066.36443630
              0.1492910211, # 11         533.18221815
              0.0746455105, # 12         266.59110908
      ]


globals:
  http:
    ssl_no_cert_checks: True
    client_timeout: 10000

  #srs:
  #  proj_data_dir: '.'

  # # cache options
  #cache:
    # where to store the cached images
  #  base_dir: './paris_cache'
    # where to store lockfiles
    #lock_dir: './world_cache/locks'
    #tile_lock_dir: './world_cache/tile_locks'
    #meta_size: [2,2]
    #bulk_meta_tiles: true
    #concurrent_tile_creators: 2
  #   # request x*y tiles in one step
  #   meta_size: [4, 4]
  #   # add a buffer on all sides (in pixel) when requesting
  #   # new images
  #   meta_buffer: 80

  # image/transformation options
  image:
    #resampling_method: nearest
    #resampling_method: bilinear
    resampling_method: bicubic
    jpeg_quality: 95
  #     # stretch cached images by this factor before
  #     # using the next level
  #     stretch_factor: 1.15
  #     # shrink cached images up to this factor before
  #     # returning an empty image (for the first level)
  #     max_shrink_factor: 4.0
    paletted: false
      
  #tiles:
  #  expires_hours: 24

I loaded the MapProxy WMS service into QGIS (see picture above).

3
  • Thanks you for your reply. Unfortunately, the export operation provides only "empty" tiles : i.imgur.com/JcF0qof.png The excepted tiles are that ones: arcgis.com/apps/instant/media/… Commented May 5 at 20:15
  • I changed the Yaml file to use WebMercator instead of EPSG:2154 and removed the GeoPackage cache. The WMS layer is shown in QGIS as you can see in the picture.
    – christoph
    Commented May 5 at 20:48
  • @divulgacheur you are absolutely right... now I understand what you mean. This following link shows a tile you want to get: capgeo2.paris.fr/public/rest/services/IGC/… Unfortunately, with export operation you only get the data frames... but I guess it must be possible to get the images as well.
    – christoph
    Commented May 5 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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