[mapserver-users] MapCache dimensions with MapServer run time substitution

Travis Kirstine traviskirstine at gmail.com
Tue Jul 7 10:36:18 PDT 2020


Is it possible to utilize mapcache regex dimensions with mapserver run time
substitution (wms) to create a more dynamic and generic tile service

Here is my basic configuration for mapserver and mapcache, I can't seem to
get it working with QGIS when connecting to the WMTS

For example I use run time substitution with my PG DATA settings

  LAYER
    NAME "sub_layer"
    .......
    VALIDATION
      'layer_table' ^.*$'
      'layer_class' '^.*$'
    END
    CONNECTIONTYPE postgis
    CONNECTION "port=9999 user=user password=pw dbname=db host=mydb"
    DATA "the_geom from (SELECT gid, ms_color, the_geom FROM %layer_table%
WHERE class='%layer_class%') AS foo USING UNIQUE gid using SRID=4326"
     ....
  END

I set my MapCache config up with the same runtime variables as dimensions

   <source name="source_wms" type="wms">
      <getmap>
         <params>
            <FORMAT>image/png</FORMAT>
            <TRANSPARENT>true</TRANSPARENT>
            <LAYERS>sub_layer</LAYERS>
         </params>
      </getmap>
      <http>
         <url>http://testserver.com/cgi-bin/wms?</url>
      </http>
   </source>
   <tileset name="tileset_regex">
      <source>source_wms</source>
      <cache>composite</cache>
      <grid>GoogleMapsCompatible</grid>
      <format>PNG</format>
      <metatile>5 5</metatile>
      <metabuffer>10</metabuffer>
      <expires>3600</expires>
      <auto_expire>604800</auto_expire>
      <dimensions>
        <dimension type="regex" name="layer_class" default="none">
          <regex>^.*$</regex>
        </dimension>
        <dimension type="regex" name="layer_table" default="none">
          <regex>^.*$</regex>
        </dimension>
      </dimensions>
   </tileset>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20200707/ea84d114/attachment.html>


More information about the mapserver-users mailing list