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

Carola Kaiser ckaiser at cct.lsu.edu
Tue Feb 2 07:47:33 PST 2016


Thomas,

 

Thank you for getting back to me! These new features are exactly what I need. I will definitely give the new version  a try.

 

Thanks!

Carola

 

~~~~~~~~~~~~~~~~~~~~~~~~~~

Carola Kaiser, IT Consultant & GIS specialist

Center for Computation & Technology

Louisiana State University

e-mail:  <mailto:ckaiser at cct.lsu.edu> ckaiser at cct.lsu.edu

CERA:  <http://coastalemergency.org> http://coastalemergency.org

 

 

 

From: thomas bonfort [mailto:thomas.bonfort at gmail.com] 
Sent: Monday, February 1, 2016 1:20 PM
To: Carola Kaiser <ckaiser at cct.lsu.edu>
Cc: MapserverList OSGEO <mapserver-users at lists.osgeo.org>
Subject: Re: [mapserver-users] How can I get a customized MapCache folder structure with several dimensions as subfolders

 

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:  <mailto:ckaiser at cct.lsu.edu> ckaiser at cct.lsu.edu

CERA:  <http://coastalemergency.org> http://coastalemergency.org

 

 

 


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org <mailto:mapserver-users at lists.osgeo.org> 
http://lists.osgeo.org/mailman/listinfo/mapserver-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160202/57834c97/attachment.htm>


More information about the MapServer-users mailing list