使用MapProxy TMS缓存OSM

时间:2019-07-10 12:46:17

标签: python gis openlayers openstreetmap

出于开发目的,我想使用ESPG:25832中的MapProxy缓存OSM磁贴,并将其用作代理TMS服务。

在QGIS中,WMS / WMTS服务看起来不错,但是在QGIS和OpenLayers中,TMS的调整都不正确。

我有一个配置mapproxy.yaml文件,如下所示:

services:
  demo:
  tms:
  wmts:
  wms:
    srs: ['EPSG:25832', 'EPSG:900913', 'EPSG:2154','EPSG:3857']

layers:
  - name: osm
    title: Open Streetmap Tiles EPSG:25832
    sources: [osm_cache]

caches:
  osm_cache:
    grids: [osm_grid]
    meta_size: [4, 4]
    sources: [osm_cache_in]
    format: image/jpeg

  osm_cache_in:
    grids: [GLOBAL_WEBMERCATOR]
    disable_storage: true
    sources: [osm_source]

sources:
  osm_source:
    type: tile
    grid: GLOBAL_WEBMERCATOR
    url: http://a.tile.openstreetmap.org/%(z)s/%(x)s/%(y)s.png

grids:
  osm_grid:
    srs: 'EPSG:25832'
    bbox: [388309.92,5265326.14,609798.17,5515636.81]
    bbox_srs: 'EPSG:25832'
    origin: 'nw'
    tile_size: [256, 256]

globals:
  cache:
    # where to store the cached images
    base_dir: '/mapproxy/cache_data'
    # where to store lockfiles
    lock_dir: '/mapproxy/cache_data'

我将以TMS形式添加到QGIS中的图层的示例网址为http://127.0.0.1:8080/tms/1.0.0/osm/EPSG25832/ {z} / {x} / {-y} .jpeg

QGIS和OpenLayers强制将该层重新投影到EPSG:3857,并调整其几何形状,使其远离应有的位置-不知道为什么。 enter image description here

0 个答案:

没有答案