[mapserver-users] How can I get a customized MapCache folder structure with several dimensions as subfolders

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Feb 1 12:17:36 PST 2016


Hi Carola,

MS4W builds contain MapCache 1.4.0 (released in July).  The next MS4W 
release will include MapCache-master, but in fact we've recently been 
hitting a compiler error with MapCache-master.

You can follow along this progress, in the associated MapCache ticket 
(https://github.com/mapserver/mapcache/issues/139) as well as the MS4W 
ticket for adding this support (http://ms4w.com/trac/ticket/39).

Thanks,

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2016-02-01 3:20 PM, thomas bonfort wrote:
> Carola,
>
> If you are willing to try out the master branch you can specify the keys
> in the disk template as {dim:dimname}, I.e. in your case:
>
> /path/{dim:year}/{dim:month}/etc..
>
> Make sure to read the migration-guide.txt as the syntax to define
> dimensions has changed a little.
>
> --
> Thomas
>
> On Feb 1, 2016 12:33 PM, "Carola Kaiser" <ckaiser at cct.lsu.edu
> <mailto:ckaiser at cct.lsu.edu>> wrote:
>
>     Hello,____
>
>     __ __
>
>     I am using MapServer 7.0 with MapCache and would like to customize
>     the cache storage directory structure by using several dimensions as
>     subfolders.____
>
>     The goal is to get a cache folder structure like:____
>
>     C:/ms4w/tmp/ms_tmp/cache/{YEAR}/{MONTH}/{DAY}/{z}/{y}/{x}.{ext}____
>
>     __ __
>
>     Here is what I have tried in my mapcache.xml file:____
>
>     __1.__Use the <base></base> absolute path____
>
>     __ __
>
>         <cache name="disk" type="disk">____
>
>            <base>C:/ms4w/tmp/ms_tmp/cache/</base>____
>
>         </cache>____
>
>     ____
>
>         <source name="vmap0" type="wms"> ____
>
>     …____
>
>         </source>____
>
>     ____
>
>         <tileset name="test">____
>
>            <source>vmap0</source>____
>
>            <cache>disk</cache>____
>
>            <grid>WGS84</grid>____
>
>            <format>PNG</format>____
>
>            <dimensions>____
>
>                      <dimension type="regex" name="YEAR"
>     default="2016">^[0-9]{4}$</dimension>____
>
>                       <dimension type="regex" name="MONTH"
>     default="00">^[0-9]{2}$</dimension>____
>
>                      <dimension type="regex" name="DAY"
>     default="00">^[0-9]{2}$</dimension>____
>
>            </dimensions>____
>
>         </tileset>____
>
>     __ __
>
>     This works pretty nice but the final folder structure is:____
>
>     C:/ms4w/tmp/ms_tmp/cache/test/WGS84/{YEAR}/{MONTH}/{DAY}/{z}/{y}/{x}.{ext}____
>
>     How can I get rid of the test/WGS84 folders?____
>
>     __ __
>
>     __2.__Use the cache template tag____
>
>     __ __
>
>         <cache name="disk" type="disk" layout=”template”>____
>
>
>     <template>C:/ms4w/tmp/ms_tmp/cache/{YEAR}/{MONTH}/{DAY}/{z}/{y}/{x}.{ext}</template>____
>
>         </cache>____
>
>     ____
>
>         <source name="vmap0" type="wms">____
>
>     …____
>
>         </source>____
>
>     ____
>
>         <tileset name="test">____
>
>            <source>vmap0</source>____
>
>            <cache>disk</cache>____
>
>            <grid>WGS84</grid>____
>
>            <format>PNG</format>____
>
>            <dimensions>____
>
>                <dimension type="regex" name="YEAR"
>     default="2016">^[0-9]{4}$</dimension>____
>
>                <dimension type="regex" name="MONTH"
>     default="00">^[0-9]{2}$</dimension>____
>
>                <dimension type="regex" name="DAY"
>     default="00">^[0-9]{2}$</dimension>____
>
>            </dimensions>____
>
>         </tileset>____
>
>     __ __
>
>     The template does only allow me to concatenate all dimensions like
>     {YEAR}_{MONTH}_{DAY} but not to create a subfolder name from each
>     dimension:____
>
>     /{YEAR}/{MONTH}/{DAY}/____
>
>     __ __
>
>     Is it possible to customize the cache folder structure and how can I
>     achieve this? Any help is very much appreciated!____
>
>     __ __
>
>     Thanks!____
>
>     Carola____
>
>     __ __
>
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~____
>
>     Carola Kaiser, IT Consultant & GIS specialist____
>
>     Center for Computation & Technology____
>
>     Louisiana State University____
>
>     e-mail: ckaiser at cct.lsu.edu <mailto:ckaiser at cct.lsu.edu>____
>
>     CERA: http://coastalemergency.org____
>
>     __ __
>
>     __ __
>





More information about the mapserver-users mailing list