I'm trying to cache OpenStreetMap related tile. The corresponding server has separate data related to opeenstreetmap (http://xx.xx.xx.xx/osm). It's an XZY Tiles service. Within the mapcache.xml file I set the source type to be tms service. But when I restart my Apache service I get a message:unknown source type tms for source osm.

Mapcache.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<mapcache >
   <cache name="disk" type="disk">

   <source name="osm" type="tms">


   <tileset name="test">
      <metatile>5 5</metatile>

   <service type="tms" enabled="true">
   <service type="wms" enabled="true">
   <service type="wmts" enabled="true"/>
   <service type="kml" enabled="true"/>
   <service type="gmaps" enabled="true"/>
   <service type="ve" enabled="true"/>
   <service type="demo" enabled="true"/>



Why does it report that the unknown type is tms if it exists as a defined service?


I can read from the documentation https://mapserver.org/mapcache/config.html

A source is a service mod-mapcache can query to obtain image data. This is typically a WMS server accessible by a URL. (There are currently only WMS, WMTS and mapfile as sources, though others may be added later if the need arises, see Data Sources).

The error message is telling that "tms" type of service is not supported as a source. The documentation about how to configure the supported source types is in https://mapserver.org/mapcache/sources.html#mapcache-sources

You can use tms service as a source with MapProxy https://mapproxy.org/docs/nightly/sources.html.


In the MapCache terminology, service refers to protocols used for querying local MapCache and source refers to protocols used for querying remote servers.

XZY Tiles services like OSM can be accessed by MapCache with a REST cache configuration. If you need to cache it locally, you can define a tileset using this REST cache, then a WMS source + cache + tileset refering to this tileset:

<cache name="remote-openstreetmap" type="rest">
<tileset name="remote-openstreetmap">

<source name="openstreetmap" type="wms">
<cache name="openstreetmap" type="sqlite3">
<tileset name="openstreetmap">

<service type="wms" enabled="true"/>

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.