[mapserver-users] mapcache WMTS - TMS one tile offset

mapserver mapserver at markus-spring.de
Fri Oct 10 13:12:48 PDT 2014


Disclaimer: I have asked this question already on openlayers-users, but not 
received any answer
---

I have set up a mapserver/mapcache service for tiled background maps, which 
should offer WMTS and TMS services
in the EPSG:31468 projection.

The TMS tiles I've verified to be correctly placed against a standard wms layer, 
however the WMTS tiles get placed with
a one tile offset to the south compared to the TMS tiles.

Please see the screenshot: 
http://markus-spring.info/varia/wmts_tms_offset_problem.jpg

The grid definition is as follows:

     <grid name="MUC31468">
        <metadata>
           <title>Mapcache Service City of Munich EPSG 31468</title>
        </metadata>
        <srs>EPSG:31468</srs>
        <size>256 256</size>
        <extent>4440016 5313983 4492016 5359983</extent>
        <units>m</units>
        <resolutions>141.11153491115225 70.55561745557612
                     42.33331047334567 35.27775872778806 26.458319045841048
                     17.63887936389403 8.819439681947015 3.527775872778806
                     2.6458319045841043 1.763887936389403 0.8819439681947016
                     0.35277758727788067 0.17638879363894033</resolutions>
     </grid>

and the tileset

     <tileset name="karte_2014-1">
        <source>karte_2014-1</source>
        <cache>disk</cache>
        <metadata>
           <title>karte_2014-1</title>
           <abstract></abstract>
        </metadata>
        <format>PNG</format>
        <metatile>5 5</metatile>
        <metabuffer>10</metabuffer>
        <dimensions>
          <dimension type="regex" name="MAPFILE"
default="/path/to/mapfile.map">^[a-zA-Z0-9\./]*\.map$</dimension>
        </dimensions>
        <grid>MUC31468</grid>
     </tileset>


while the service definitions (for OpenLayers 2.13) are these:

            var wmts = new OpenLayers.Layer.WMTS({
                name:        "WMTS basemap",
                url:         "http://centmap/mapcache/wmts?",
                layer:       "karte_2014-1",
                matrixSet:   "MUC31468",
                format:      "image/png",
                style:       "default",
                opacity:     0.7,
                maxExtent:   maxExtent,
                isBaseLayer: true
            });

            var tms = new OpenLayers.Layer.TMS(
                "TMS basemap",
                "http://centmap/mapcache/tms/",
                { layername: "karte_2014-1",
                  type:      "png" }
            );

Any help would be greatly appreciated.

---Markus



More information about the mapserver-users mailing list