[mapserver-dev] how to use tiles from gdal2tiles

Bruce Clay bclay1297 at gmail.com
Tue Nov 9 06:48:32 PST 2021


My apologies to those on the GDAL list as well as here I posted ther a
couple of days ago but did not get any replies.

We have tile sets created by gdal2tiles.py as well as from other tools.  We
need to display the tiles i web using frameworks such as such as cesium or
worldwindjs.  We are using the latest mapserver from ms4w on windows 10.
iI we use seed_cache we get a tileset quite different from that of
gdal2tiles.  we configured the mapcache.xml file for those datasets and
they appear to work ok in QGIS.  Using the same configuration style for the
slippy map tiles lets them show in a get capabilities but not in QGIS nor a
simple one tile query.

the mapcache,xml entries are basicallt as follows

   <cache name="tileset_a_cache" type="disk">
     <base>C:/data_static/MapTiles</base>
  </cache>

  <source name="tileset_a_src" type="wms">
  <getmap>
    <params>
      <FORMAT>image/png</FORMAT>
      <LAYERS>TileSetA</LAYERS>
      <MAP>/data/config/map/nasaww.map</MAP>
    </params>
  </getmap>
  <http>
    <url>http://localhost/cgi-bin/mapserv.exe?</url>
  </http>
</source>

<tileset name=" tileset_a  ">
   <source> tileset_a  _src</source>
        <cache> tileset_a  _cache</cache>
        <grid>GoogleMapsCompatible</grid>
        <grid>g</grid>
        <format>PNG</format>
        <metatile>8 8</metatile>
    </tileset>


If I query wmts capabilities the dataset show in the list

http://localhost/mapcache/wmts?service=wmts&request=getcapabilities&version=1.0.0

<Layer>
<ows:Title>tileset_a</ows:Title>
<ows:Identifier> tileset_a  </ows:Identifier>
<Style isDefault="true">
<ows:Identifier>default</ows:Identifier>
</Style>
<Format>image/png</Format>
<TileMatrixSetLink>
<TileMatrixSet>GoogleMapsCompatible</TileMatrixSet>
</TileMatrixSetLink>
<TileMatrixSetLink>
<TileMatrixSet>g</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/png" resourceType="tile" template="
http://localhost/mapcache/wmts/1.0.0/tileset_a/default/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png
"/>
</Layer>

if I add a wmts layer using the following in QGIS the layer shows in the
list
http://localhost/mapcache/wmts?service=wmts&request=getcapabilities&version=1.0.0

no tiles are displayed and the server error log has several entries of
WMS server error. Invalid layer(s) given in the LAYERS parameter.

if I try to add the tiles as andXYZ layer using the following no tiles are
displayed

http://localhost/mapcache/tms/1.0.0/tileset_a/{x}/{y}/{z}.png
but no errors are added to the error log

When some of the other application generate the slippy maps we do not have
the source images so we cannot add that to the map file

What is the proper way to use the tiles generated by gdal2tiles.py with
mapserver?

Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20211109/9e57b1dc/attachment.html>


More information about the MapServer-dev mailing list