欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

MapProxy 部署和 TMS 地图服务代理_GIS Dreamer - 测试代理地图服务

最编程 2024-03-23 17:19:17
...

MapProxy支持对WMS、WMS-C、WTMS、TMS等服务的代理,所有的都只需要你在yml文件里配置,上手还是比较快的,对不懂开发人是很友好的。我的测试配置如下mapproxy.yaml

services:
  demo:
  tms:
    use_grid_names: true
    # origin for /tiles service
    origin: 'nw'
  kml:
      use_grid_names: true
  wmts:
  wms:
    md:
      title: MapProxy WMS Proxy
      abstract: This is a minimal MapProxy example.

layers:
  - name: osm_utm
    title: 智图测试
    sources: [osm_cache_tile]
caches:
  osm_cache_tile:
    grids: [osm_grid]
    # true会禁用本地缓存
    disable_storage: false
    # a tile source you want to reproject
    sources: [osm_source]

sources:
  osm_source:
    type: tile
    grid: osm_grid
    url:  https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/%(z)s/%(y)s/%(x)s   
grids:
    webmercator:
        base: GLOBAL_WEBMERCATOR
    osm_grid:
        base: GLOBAL_MERCATOR
        srs: 'EPSG:3857'
        origin: nw

globals:


这里一定要注意

对于TMS服务的url,一定是%(z)s/%(y)s/%(x)s这种格式的,不能是{z}/{y}/{x}

预览效果图

查看本地mapproxy.yaml所在同级目录下,出现了一个cache_data文件夹,点进去可以看到都是缓存的瓦片

本文转自 https://blog.****.net/GISuuser/article/details/121394995,如有侵权,请联系删除。