配置文件

作者

托马斯堡

联系

t在terriscope.fr的端口

配置文件确定mod mapcache如何处理传入请求。它是一个包含条目列表的XML文件,如下所述:

<mapcache>
   <grid>....</grid>
   <source>....</source>
   <cache>...</cache>
   <format>...</format>
   <tileset>...</tileset>
   <service>...</service>
   <metadata>....</metadata>
</mapcache>

备注

只有在ApacheWeb服务器启动并加载mapcache模块时,才能读取mapcache配置文件。如果修改此文件,则必须重新启动Apache才能使更改生效。

来源

一个源是一个服务mod mapcache可以查询获取图像数据。这通常是一个可以通过URL访问的WMS服务器。(目前只有wms、wmt和mapfile作为源,但如果需要,以后可能会添加其他源,请参见 数据源

<source name="vmap0" type="wms">

   <!--
      Extra parameters that will be added to the GetMap request. You can
      specify any parameter here, e.g. VERSION if you want to override the
      version of the WMS request.

      The LAYERS parameter is mandatory.

      Usual parameters here are FORMAT, or MAP if using MapServer.
   -->
   <getmap>
      <params>
         <FORMAT>image/png</FORMAT>
         <LAYERS>basic</LAYERS>
      </params>
   </getmap>

   <!-- HTTP URL and parameters to be used when making WMS requests -->
   <http>

      <!-- URL of the WMS service, without any parameters -->
      <url>http://vmap0.tiles.osgeo.org/wms/vmap0</url>

      <!--
         HTTP headers added to the request. Make sure you know what you are
         doing when adding headers here, as they take precedence over any
         default headers curl will be adding to the request.

         Typical headers that can be added here are User-Agent and Referer.

         When adding a <key>value</key> element here, the request to the WMS
         source will contain the

         key: value\r\n

         HTTP header.

         You may also forward a header from the incoming client request using
         the <MyHeader>{X-Header-To-Forward}<MyHeader> syntax.
      -->
      <headers>
         <User-Agent>mod-mapcache/r175</User-Agent>
         <Referer>http://www.mysite.com?param=2&amp;par=4</Referer>
      </headers>

      <!-- Timeout in seconds before bailing out from a request -->
      <connection_timeout>30</connection_timeout>
   </http>
</source>

type name 是引用此源的键;“<url>”是可以访问服务的HTTP位置;“<wmsparams>”是将添加到WMS请求的参数列表。您至少应该添加格式和图层参数。按惯例(?),wms参数为大写,您应该在配置文件中遵守此约定。

在这里,您还可以根据需要覆盖一些默认的WMS参数。默认情况下,将使用的参数是:<request>getmap=`<service>wms=`<styles>`<version>1.1.0=`version>

隐藏物

缓存是存储接收到的磁贴的位置。

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

   <!-- base

        Absolute filesystem path where the tile structure will be stored.

        This directory needs to be readable and writable by the user running
        Apache.
   -->
   <base>/tmp</base>

   <!-- symlink_blank

        Enable blank (i.e. uniform color) tile detection. Blank tiles will be
        detected at creation time and linked to a single blank tile on disk
        to preserve disk space.
   -->
   <symlink_blank/>
</cache>

<cache name="tmpl" type="disk" layout="template">
   <!-- template

        String template that will be used to map a tile (by tileset, grid
        name, dimension, format, x, y, and z) to a filename on the filesystem.

        The following replacements are performed:

        - {tileset}               : the tileset name
        - {grid}                  : the grid name
        - {dim}                   : string concatenating the tile's dimension
        - {ext}                   : tile's image-format filename extension
        - {x},{y},{z}             : tile's x,y,z values
        - {inv_x},{inv_y},{inv_z} : inverted x,y,z values

        (For inverted x,y,z values, (inv_x = level->maxx - x - 1). This is
        mainly used to support grids where one axis is inverted (e.g. the
        Google schema) and you want to create on offline cache.)

      * Note that this type of cache does not support blank-tile detection
        and symlinking.

      * Warning: It is up to you to make sure that the template you choose
        creates a unique filename for your given tilesets (e.g. do not omit
        the {grid} parameter if your tilesets reference multiple grids.)
        Failure to do so will result in filename collisions!

   -->
   <template>/tmp/template-test/{tileset}#{grid}#{dim}/{z}/{x}/{y}.{ext}</template>
</cache>

<!-- memcache cache

     Entry accepts multiple <server> entries.

     Requires a fairly recent apr-util library and headers.
-->
<cache name="memcache" type="memcache">
   <server>
      <host>localhost</host>
      <port>11211</port>
   </server>
</cache>

<!-- sqlite cache

     Requires building with "with-sqlite".
-->
<cache name="sqlite" type="sqlite3">
   <!-- dbfile

        Absolute filename path of the SQLite database file to use.

        This file needs to be readable and writable by the user running the
        MapCache instance.
   -->
</cache>

<cache name="mbtiles" type="mbtiles">
   <dbfile>/path/to/MapBox/tiles/natural-earth-1.mbtiles</dbfile>
</cache>

格式

格式是一种图像格式,用于将磁贴数据返回到客户端,并将磁贴数据存储在磁盘上。

<format name="PNGQ_FAST" type ="PNG">

   <!-- compression

        PNG compression: best or fast

        Note that "best" compression is CPU intensive for little gain over
        the default default compression obtained by leaving out this tag.
   -->
   <compression>fast</compression>

   <!-- colors

        If supplied, this enables PNG quantization which reduces the number
        of colors in an image to attain higher compression. This operation is
        destructive, and can cause artifacts in the stored image.

        The number of colors can be between 2 and 256.
  -->
  <colors>256</colors>
</format>
<format name="myjpeg" type ="JPEG">

   <!-- quality

        JPEG compression quality, ranging from 0 to 100.

        95 produces high quality images with few visual artifacts. Values
        under around 80 produce small images but with visible artifacts.
        YMMV.
   -->
   <quality>75</quality>

   <!-- photometric

       Photometric interpretation of the bands created in the JPEG image.

       Default is "ycbcr", which produces the smallest images. Can also be
       "rgb", which usually results in x2 or x3 image sizes.
   -->
   <photometric>ycbcr</photometric>

</format>

<format name="PNG_BEST" type ="PNG">
   <compression>best</compression>
</format>

<format name="mixed" type="MIXED">
   <transparent>PNG_BEST</transparent>
   <opaque>JPEG</opaque>
</format>

网格

网格是将图块映射到区域上的矩阵,它由空间参考、地理范围、分辨率和图块大小组成。

强制配置选项

  • **<size>>:单个瓷砖的宽度和高度,以像素为单位。必须指定为用空格字符分隔的正整数。最常见的瓷砖尺寸是:

    <size>256 256</size>
    
  • **<extent>>:网格覆盖的地理范围,以地面单位(例如米、度、英尺等)表示。必须指定为4个由空格分隔的浮点数,顺序为minx、miny、maxx、maxy。

    mapcache希望它的所有扩展数据块都以lonlat提供,并在需要时按请求时间转换为latlon。

    (minx,miny)点定义网格的原点,即位于最左下角的图块左下角的像素始终放置在(minx,miny)地理点上。

    (maxx,maxy)点用于确定每个缩放级别有多少个图块。

    <extent>-180 -90 180 90</extent>
    
  • **<srs>>:网格的投影,通常由epsg标识符给出。mapcache不直接使用此值来计算重投影;它只用于在接收WMS请求时查找要使用的网格。

    <srs>epsg:4326</srs>
    

    备注

    这是传递给 source 请求尚未为当前网格缓存的磁贴时。必须确保查询的源能够返回此SRS的图像数据。

  • **<units>>:网格投影使用的地面单位。除了计算WMTS功能文档的比例之外,mapcache不直接使用此条目。允许值为:

    • m :米

    • dd :十进制度数

    • ft :脚

    <units>dd</units>
    
  • **<resolutions>>:这是网格定义的每个缩放级别的分辨率列表。这必须作为正浮点值的列表提供,用空格分隔,并从大到小排列。最大值将对应于网格的缩放级别0。分辨率以“每像素单位”表示,具体取决于网格使用的单位(例如,对于网络映射中使用的大多数网格,分辨率以每像素米为单位)。

    <resolutions>0.703125000000000 0.351562500000000 0.175781250000000 8.78906250000000e-2 4.39453125000000e-2 2.19726562500000e-2 1.09863281250000e-2 5.49316406250000e-3 2.74658203125000e-3 1.37329101562500e-3 6.86645507812500e-4 3.43322753906250e-4 1.71661376953125e-4 8.58306884765625e-5 4.29153442382812e-5 2.14576721191406e-5 1.07288360595703e-5 5.36441802978516e-6</resolutions>
    

可选配置选项

  • <srsalias>:可以多次指定此标记,并允许用户为给定网格添加多个SRS条目。如果给定投影的epsg id随着时间的推移而变化,或者支持epsg id以外的目录(这是WMS规范支持的唯一目录),则这一点尤其有用。

    <srs>EPSG:310024802</srs>
    <srsalias>IGNF:GEOPORTALFXX</srsalias>
    <srsalias>EPSG:310024001</srsalias>
    
  • **元数据> **

    • <title>:网格的名称,以人类可读的形式。出现在功能文档中。

      <title>This grid covers the area blah blah blah</title>
      
    • **<wellknownscaleset>>:请参见wmts关键字。这将在WMTS能力文档中添加wellknownscaleset条目。用户应确保为网格提供的分辨率与预先定义的WellKnownsCaleset实际匹配。

      <WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad</WellKnownScaleSet>
      
  • <origin>:指定网格的原点。有效值为 top-left, bottom-left, top-rightbottom-right.

    如果不使用,网格将以左下角作为参考点。

    <origin>top-left</origin>
    

预配置网格

在mapcache.xml文件中,可以使用三个预定义网格,而无需定义它们:

  • “wgs84”网格对应于一个网格,其中整个世界在0级的两个256x256像素块上渲染(即,-180,-90180,90)范围适合512x256图像)。它下降到缩放级别17。

    <grid name="WGS84">
       <metadata>
          <title>GoogleCRS84Quad</title>
          <WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad</WellKnownScaleSet>
       </metadata>
       <extent>-180 -90 180 90</extent>
       <srs>EPSG:4326</srs>
       <units>dd</units>
       <size>256 256</size>
       <resolutions>0.703125000000000 0.351562500000000 0.175781250000000 8.78906250000000e-2 4.39453125000000e-2 2.19726562500000e-2 1.09863281250000e-2 5.49316406250000e-3 2.74658203125000e-3 1.37329101562500e-3 6.86645507812500e-4 3.43322753906250e-4 1.71661376953125e-4 8.58306884765625e-5 4.29153442382812e-5 2.14576721191406e-5 1.07288360595703e-5 5.36441802978516e-6</resolutions>
    </grid>
    
  • “G”网格可用于在Google地图上覆盖瓷砖,它是WebMapping应用程序中使用的默认平铺方案。此网格向下显示为缩放级别18。0级是单个256x256瓷砖。这个网格的默认SRS是epsg:900913,它是非标准的,但是比它的官方epsg:3857条目的使用范围更广。

    <grid name="g">
       <metadata>
          <title>GoogleMapsCompatible</title>
          <WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet>
       </metadata>
       <extent>-20037508.3427892480 -20037508.3427892480 20037508.3427892480 20037508.3427892480</extent>
       <srs>EPSG:900913</srs>
       <srsalias>EPSG:3857</srsalias>
       <units>m</units>
       <size>256 256</size>
       <resolutions>156543.0339280410 78271.51696402048 39135.75848201023 19567.87924100512 9783.939620502561 4891.969810251280 2445.984905125640 1222.992452562820 611.4962262814100 305.7481131407048 152.8740565703525 76.43702828517624 38.21851414258813 19.10925707129406 9.554628535647032 4.777314267823516 2.388657133911758 1.194328566955879 0.5971642834779395</resolutions>
    </grid>
    
  • “GoogleMapsCompatible”网格几乎与“G”网格相同,只是它的默认SRS是epsg:3857而不是epsg:900913。

    <grid name="GoogleMapsCompatible">
       <metadata>
          <title>GoogleMapsCompatible</title>
          <WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet>
       </metadata>
       <extent>-20037508.3427892480 -20037508.3427892480 20037508.3427892480 20037508.3427892480</extent>
       <srs>EPSG:3857</srs>
       <srsalias>EPSG:900913</srsalias>
       <units>m</units>
       <size>256 256</size>
       <resolutions>156543.0339280410 78271.51696402048 39135.75848201023 19567.87924100512 9783.939620502561 4891.969810251280 2445.984905125640 1222.992452562820 611.4962262814100 305.7481131407048 152.8740565703525 76.43702828517624 38.21851414258813 19.10925707129406 9.554628535647032 4.777314267823516 2.388657133911758 1.194328566955879 0.5971642834779395</resolutions>
    </grid>
    

蒂莱塞

tileset是mod mapcache的基本配置项,对应于来自 来源, 存储在 隐藏物, 在一个给定的 格式.

<tileset name="test">

   <!-- source

        The "name" attribute of a preconfigured <source>.

        If the tileset does not contain a <source> element, then it is
        considered read-only and its cache will never be updated. In this
        case, your seeder and webserver would have slightly different
        mapcache.xml files.

        Blank tiles may be dealt with by setting the <errors> directive to
        "empty_img".
   -->
   <source>vmap0</source>

   <!-- cache

        The "name" attribute of a preconfigured <cache>
   -->
   <cache>sqlite</cache>

   <!-- grid

        The "name" attribute of a preconfigured <grid>.

        You can also use the following notation to limit the area that will
        be cached and served to clients:

        <grid restricted_extent="-10 40 10 50">WGS84</grid>

        This is better than using a grid with a limited extent, as in this
        way the tiles that are already cached are not invalidated should you
        want to modify the restricted extent in the future. When using the
        restricted_extent attribute, you should give the corresponding
        information to the client that will be using the service.

        You can also limit the zoom levels that are cached/accessible by
        using the `minzoom` and `maxzoom` attributes.

        Moreover, a tolerance of five tiles is added by default to the
        specified restricted_extent. This tolerance can be manually set with
        `tolerance` attribute.

        A grid may reference a ruleset to impose certain behaviour:

        <grid ruleset="rules">4326</grid>

        NOTE: When adding a <grid> element, you *MUST* make sure that the
        source you have selected is able to return images in the grid's SRS.
   -->
   <grid restricted_extent="-10 40 10 50" minzoom="4" maxzoom="17">WGS84</grid>
   <grid ruleset="rules">4326</grid>
   <grid>g</grid>

   <!-- You may store hidden intermediate levels of tiles to enable higher
        quality output when reassembling tiles. This may be needed when
        caching maps containing labels to avoid the text from becoming too
        small or too blurry when requesting resolutions that are far away
        from the native grid resolutions.

        Supposing grid "mygrid" consists of 256x256 pixel tiles, with
        resolutions r1,r2,r3,r4,...rn, MapCache will populate a hidden grid
        called "mygrid_intermediate_0.5" containing tiles of size
        256+256*0.5=384 with resolutions r1+(r2-r1)*0.5, r2+(r3-r2)*0.5, ...
        r(n-1)+(r(n)-r(n-1)*0.5. That is, a tile with a given extent will be
        stored once in a 256x256 tile, and once in a 384x384 one.

        This intermediate grid is private to MapCache and will not be exposed
        to tiled requests. It will only be used for WMS requests that require
        horizontal assembling.
   -->
   <grid use_wms_intermediate_resolutions="true">mygrid</grid>

   <!-- metadata

        Optional metadata tags used for responding to GetCapabilities
        requests. You can put anything here, but only the title, abstract and
        keywords tags are currently used to populate the GetCapabilities
        document.
   -->
   <metadata>
      <title>vmap0 map</title>
      <abstract>blabla</abstract>
      <keywords>
         <keyword>foo</keyword>
         <keyword>bar</keyword>
      </keywords>
   </metadata>

   <!-- watermark

        Optional tag to add a watermark to the tiles *before* storing them to
        cache. The supplied image MUST be exactly the same size as the size
        as the tiles configured in the <grid>.

        The supplied image is read when the configuration is loaded. If you
        make changes to the image, they will NOT be reflected in tiles
        already stored in the cache, nor on newly stored tiles, until the
        server is restarted.
   -->
   <watermark>/path/to/static/watermark.png</watermark>

   <!-- format

       (Optional) format to use when storing a tile. This should be a format
       with high compression, e.g. PNG with compression "best", as the
       compression operation is only done once at tile creation time. If
       omitted, no recompression is applied to the image and mod-mapcache
       will store the exact image received from the <source>.

       Note that the <format> tag is mandatory if <metatile>, <metabuffer> or
       <watermark> are supplied, as in those cases recompression must be
       done.
   -->
   <format>PNG</format>

   <!-- metatile

        Number of columns and rows to use for metatiling. See
        http://geowebcache.org/docs/current/concepts/metatiles.html
   -->
   <metatile>5 5</metatile>

   <!-- metabuffer

        Area around the tile or metatile that will be cut off to prevent some
        edge artifacts. If this is specified, the configured source must be
        instructed not to put any labels inside this area, as otherwise
        labels will be truncated. (For MapServer, use the
        "labelcache_map_edge_buffer" "-10" metadata entry, along with label
        PARTIALS FALSE.)
   -->
   <metabuffer>10</metabuffer>

   <!-- expires

        Optional tile expiration value in seconds. This is expressed as
        number of seconds after creation date of the tile. This is the value
        that will be set in the HTTP Expires and Cache-Control headers, and
        has no effect on the actual expiration of tiles in the caches (see
        <auto_expire> for that). Defaults to 300 if unset.
   -->
   <expires>3600</expires>

   <!-- auto_expire

        Tiles older (in seconds) than this value will be re-requested and
        updated in the cache. Note that this will only delete tiles from the
        cache when they are accessed: You cannot use this configuration to
        limit the size of the created cache. Note that, if set, this value
        overrides the value given by <expires>. By default tiles don't expire.
   -->
   <auto_expire>86400</auto_expire>

   <!-- dimensions

        Optional dimensions that should be cached.

        The order of the <dimension> tags inside the <dimensions> block is
        important, as it is used to create the directory structure for the
        disk cache. That is, if you change the order of these values, any
        tiles that have been previously cached are invalidated: They are not
        removed from the cache, but they no longer exist for mod-mapcache.
   -->
   <dimensions>
      <!-- values dimension

           The example here creates a DIM1 dimension.

           * WMS and WMTS clients can now add a &DIM1=value to their request
             string. If they don't specify this key/value, the default will
             be to use DIM1=foobar.
           * The allowed values for DIM1= are foobar (it is important to add
             the default value to the allowed values entry), foobarbaz, foo
             and bar.
           * The value specified for DIM1 will be forwarded to the WMS
             source.
           * The produced tile will be stored in the file
             base/gridname/DIM1/value/xx/xx/xx/xx/xx/xx.png. That is, there
             are as many different caches created as there are values in the
             <values> tag.
      -->
      <dimension type="values" name="DIM1" default="foobar">foobar,foobarbaz,foo,bar</dimension>

      <!-- regex dimension

           The following creates a MAPFILE dimension, for using the same
           mod-mapcache tileset with different MapServer mapfiles. The name
           of the mapfiles need not be known to mod-mapcache, and can
           therefore be created even after mod-mapcache has been started.

           When a user passes a MAPFILE=/path/to/mapfile, the string
           "/path/to/mapfile" is validated against the supplied (PCRE)
           regular expression. The one in this example allows a name composed
           of aphanumeric characters separated by slashes (/) and ending in
           ".map" ( [a-zA-Z0-9\./]*\.map$ ), but will fail if there are two
           consecutive dots (..) in the path, to prevent filesystem traversal
           ( (?!.*\.\.) ).
      -->
      <dimension type="regex" name="MAPFILE" default="/path/to/mapfile.map">^(?!.*\.\.)[a-zA-Z0-9\./]*\.map$</dimension>

      <!-- intervals dimension

           The syntax is the same as common-ows, i.e. a comma-separated list
           of "min/max/resolution" entries, e.g:

           * 0/5000/1000 allows the values 0,1000,2000,3000,4000 and 5000.
           * 0/100/0 allows any values between 0 and 100.
           * Both values can be combined: 0/5000/1000,0/100/0.
      -->
      <dimension name="ELEVATION" type="intervals" default="0">0/5000/1000</dimension>

      <!-- Coming in a future version: support for ISO8601 date/time dimensions -->

   </dimensions>
</tileset>

服务

服务是mod mapcache将响应的请求类型。当然,您应该启用至少一个。

<service type="wms" enabled="true">
   <!--
        This service should actually be called "ogc". It is different from
        the other services as it does not listen on the /wms endpoint, but
        directly on /. It will intercept WMS GetMap requests that can be
        satisfied from configured tilesets, and can optionally forward all
        the rest to (an)other server(s).

        TODO: This needs way more documenting.

   <forwarding_rule name="foo rule">
     <append_pathinfo>true</append_pathinfo>
     <http>
       <url>http://localhost/mapcacheproxy</url>
     </http>
   </forwarding_rule>
   -->

   <!-- full_wms

        Configure response to WMS requests that are not aligned to a
        tileset's grids. Responding to requests that are not in the SRS of a
        configured grid is not supported, but this should never happen as
        only the supported SRSs are publicized in the capabilities document.

        Allowed values are:

        - error    : Return a 404 error (default).
        - assemble : Build the full image by assembling cached tiles.
        - forward  : Forward the request to the configured source.
   -->
   <full_wms>assemble</full_wms>

   <!-- resample mode

        Filter applied when resampling tiles for full WMS requests. Can be
        either:

        - nearest  : Fastest, poor quality.
        - bilinear : Slower, higher qulity.
   -->
   <resample_mode>bilinear</resample_mode>

   <!-- format

        Image format to use when assembling tiles.
   -->
   <format allow_client_override="true">myjpeg</format>

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

规则集

规则集包含一组规则,用于在缩放级别上强制实施某些行为。它是从tileset内的网格元素引用的。有关详细信息,请参见Tileset。

可以定义以下规则:

  • 限制缩放级别的可见范围。

<ruleset name="rules">

   <!-- rule

        A rule impose certain behaviour on one or more zoom levels.
        There is no limit on the number of rules.

        zoom_level attribute contains the levels affected by this rule.
        A zoom level can not be referenced by multiple rules.
   -->
   <rule zoom_level="4 5 6 7">

      <!-- visibility

           Contains a collection of visible extents.

           Tiles inside these extents will be fetched from the cache.
           Tiles outside will be created on the fly using configured
           color and returned to the client in declared format,
           but not stored in the cache.
           This does not affect the extent announced to the client,
           but will limit the potentially large number of blank tiles
           stored in the cache when data only covers small subsets of
           the total extent.

           hidden_color attribute is the (hex) color (ARGB or RGB) of tiles
           outside the visible extents. Default is a fully transparent tile.
      -->
      <visibility hidden_color="ff000000">

         <!-- extent

              One or more extents.

              Extent must be given in the srs of the referencing grid.
         -->
         <extent>228355 6085026 953704 7686970</extent>
      </visibility>
   </rule>

   <rule zoom_level="8 9 10">
      <visibility>
         <extent>335972 6099021 495792 6166722</extent>
         <extent>309336 6166722 644513 6273268</extent>
      </visibility>
   </rule>
</ruleset>

其他

<!-- default_format

     Format to use when a client asks for an image that is dynamically
     created from multiple cached tiles. Note that using a PNG format with
     "best" compression is not recommended here as it is computationally
     expensive. It is better to use a PNG format with "fast"compression here,
     unless you have plenty of server CPU power and/or limited bandwidth.
-->
<default_format>JPEG</default_format>

<!-- services

     Services that mod-mapcache will respond to. Each service is accessible
     at the URL http://host/path/to/mapcache/{service}, e.g.
     http://myhost/mapcache/wms for OGC WMS.
-->

<!-- errors

     Configure how errors will be reported back to a client:

     - log        : No error is reported back, except an HTTP error code.
     - report     : Return the error message to the client in textual format.
     - empty_img  : Return an empty image to the client. The actual error
                    code is in the X-Mapcache-Error HTTP header.
     - report_img : Return an image with the error text included inside. (Not
                    implemented yet.)

     The default setting is to report the error message back to the user. In
     production, you might want to set this to "log" if you're paranoid, or
     to "empty_img" if you want to play nice with non-conforming clients.
-->
<errors>report</errors>
<locker type="disk">  <!-- this is the default -->
<!--
     Where to put lockfiles (to block other clients while a metatile is being
     rendered). Defaults to /tmp. This location should be writable by the
     Apache user.
-->
  <directory>/tmp</directory>
  <retry>0.01</retry> <!-- check back every .01 seconds -->
  <timeout>60</timeout> <!-- Consider a lock stale after this many seconds.
                             May cause issues if WMS rendering time exceeds
                             this value. -->
</locker>

有关锁定的特定信息,请阅读 this .

<!-- log_level

     For CGI/FastCGI only; For the Apache module use the httpd.conf LogLevel
     key.

     Defines the verbosity of logged information. Valid values are:

     - debug
     - info
     - notice
     - warn (default)
     - error
     - crit
     - alert
     - emerg
-->
<log_level>warn</log_level>

<!-- auto_reload

     For FastCGI only. If set to true, the configuration will be
     automatically reloaded if the configuration file has changed. Default is
     false.
-->
<auto_reload>true</auto_reload>
<!-- use multiple threads when fetching multiple tiles (used for wms tile assembling -->
<threaded_fetching>true</threaded_fetching>

元数据

MapCache元数据部分包含MapCacheWMTS服务的源联系信息。此信息映射到服务器返回的WMTS GetCapability响应中的特定属性。看见 OGC WMTS Docs 有关WMTS的更多信息。整个MapCache元数据部分是可选的。

  • **元数据> **

    备注

    第一组元素是for 有关此特定服务器的元数据 。这些元素将出现在 <ows:ServiceIdentification> WMTS GetCapables响应的部分。此组中的元素包括: 标题、摘要、关键字、费用和访问限制

    • <title> :此资源的标题,通常用于向人类显示。

      <title>World example Web Map Tile Services</title>
      
    • <abstract> :对这一资源的简短叙述性描述,通常用于向人类展示。

      <abstract>Example service that contains tiles of some world layers</abstract>
      
    • <keyword> :用来描述主题的常用或正式的词或短语。允许多个,将显示在 <ows:Keywords>

      <keyword>Administrative Boundaries</keyword>
      <keyword>Geography</keyword>
      
    • <fees> :使用此服务所需的FESS声明。

      <fees>No fees for this service</fees>
      
    • <accessconstraints> :使用本服务所需的费用明细表。

      <accessconstraints>No fees for this service</accessconstraints>
      

    备注

    第二组元素用于 有关运营此服务器的组织的元数据 。这些元素将出现在 <ows:ServiceProvider> WMTS GetCapables响应的部分。此组中的元素包括: 提供商名称、提供商URL、联系人城市、联系人状态或省、联系人邮政编码、联系人国家/地区、联系人电子邮件地址、联系人名称、联系人位置、联系人电话和联系人传真

    • <providername> :服务提供商组织的唯一标识符。

      <providername>Facultat de Ciències - UAB - CREAF-MiraMon</providername>
      
    • <providerurl> :参考服务提供商最相关的网站。

      <providerurl>https://www.creaf.uab.cat/miramon</providerurl>
      
    • <contactorganization> :位置的地址行。仅供参考:此MapCache元数据元素的名称非常糟糕,并映射到 <ows:DeliveryPoint>

      <contactorganization>Av. de Can Domènech - Edifici F</contactorganization>
      
    • <contactcity> :服务提供商所在城市。

      <contactcity>Bellaterra</contactcity>
      
    • <contactstateorprovince> :服务提供商所在地的州或省。

      <contactstateorprovince>Barcelona</contactstateorprovince>
      
    • <contactpostcode> :服务提供商的邮政编码。

      <contactpostcode>08193</contactpostcode>
      
    • <contactcountry> :服务提供商实际地址的国家/地区。

      <contactcountry>Spain</contactcountry>
      
    • <contactelectronicmailaddres> :负责组织或个人的电子邮箱地址。

      <contactelectronicmailaddres>joan.maso@uab.cat</contactelectronicmailaddres>
      
    • <contactname> :负责人姓名。

      <contactname>Joan Maso Pau</contactname>
      
    • <contactposition> 负责人的角色或职位。

      <contactposition>Senior Software Engineer</contactposition>
      
    • <contactphone> :个人与负责组织或个人通话的电话号码。

      <contactphone>+34 93 581 1312</contactphone>
      
    • <contactfacsimile> :负责组织或个人的传真机电话号码。

      <contactfacsimile>+34 93 581 4151</contactfacsimile>
      

    备注

    下一组元素特定于 INSPIRE的元数据 。此组中的元素包括: inspire_profile, inspire_metadataurl, defaultlanguage

    • <inspire_profile> :启用INSPIRE扩展功能。其他激励元素工作所必需的。

      <inspire_profile/>
      
    • <inspire_metadataurl> :外部XML文档或服务,提供包含该服务的元数据的此类XML文档。

      <inspire_metadataurl>http://www.creaf.uab.cat/miramon/pycsw?SERVICE=CSW</inspire_metadataurl>
      
    • <defaultlanguage> :服务的默认语言。

      <defaultlanguage>eng</defaultlanguage>