我在服务器上有一个带有mapcache的mapserver。
我知道如何将mapcache配置为缓存来自wms服务的tile。
但我在任何地方都找不到如何配置mapcache来缓存TMS服务中的磁贴(openstreetmap https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png(
在地图缓存页面上https://mapserver.org/mapcache/index.html据说"服务WMS,WMTS,TMS,VirtualEarth/Bing和谷歌地图请求:支持的平铺服务">
我在上看到下面的行https://mapserver.org/mapcache/services.html#mapcache-服务"要激活TMS服务,请将以下行添加到mapcache.xml配置文件:
<service type="tms" enabled="true"/>
">
但是客户端从mapcache获取tms磁贴,而不是从tms服务获取磁贴
我甚至不知道这是否可能,因为我没有找到任何例子。
要从WMS获得,我有上述
<source name="name1" type="wms">
<getmap>
<params>
<LAYERS>layer1</LAYERS>
</params>
</getmap>
<http>
<url>http://an_rul.com/ows/name1</url>
</http>
</source>
<tileset name="name1">
<source>name1</source>
<cache>disk</cache>
<grid>GoogleMapsCompatible</grid>
<format>PNG</format>
<metatile>5 5</metatile>
<metabuffer>10</metabuffer>
<expires>3600</expires>
</tileset>
<service type="wms" enabled="true">
<full_wms>assemble</full_wms>
<resample_mode>bilinear</resample_mode>
<format>PNG</format>
<maxsize>4096</maxsize>
<forwarding_rule name="catch all">
<http>
<url>http://an_rul.com/ows/name1</url>
</http>
</forwarding_rule>
</service>
<service type="tms" enabled="true"/>
对于TMS,我想要这种东西
<source name="name1" type="tms"> <-- note the tms type i'd like
<getmap>
<params>
<LAYERS>layer1 ?</LAYERS> <-- what layer can I put there ?
</params>
</getmap>
<http>
<url>https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png ??</url> <-- which url should I write ??
</http>
</source>
<tileset name="name1">
<source>name1</source>
<cache>disk</cache>
<grid>GoogleMapsCompatible</grid>
<format>PNG</format>
<metatile>5 5</metatile>
<metabuffer>10</metabuffer>
<expires>3600</expires>
</tileset>
<service type="wms" enabled="true">
<full_wms>assemble</full_wms>
<resample_mode>bilinear</resample_mode>
<format>PNG</format>
<maxsize>4096</maxsize>
<forwarding_rule name="catch all">
<http>
<url>http://an_rul.com/ows/name1</url>
</http>
</forwarding_rule>
</service>
<service type="tms" enabled="true"/>
谢谢
MapCache不支持TMS作为源。看见https://mapserver.org/mapcache/config.html
源是mod mapcache可以查询以获取图像数据的服务。这通常是可通过URL访问的WMS服务器。(有目前只有WMS、WMTS和地图文件作为源,尽管其他可能是如果需要,请稍后添加,请参见数据源(。
您可以使用MapProxy,它支持TMS源(瓦片(https://mapproxy.org/docs/nightly/sources.html