"includes" in mapfiles?

Ed McNierney ed at TOPOZONE.COM
Sat Jun 4 14:37:44 PDT 2005


Joanne -
 
Not only have I done it for several years, I seem to regularly report on it in response to this question!  I use mapfiles that say things like:
 
#define UTM_ZONE    12
#include "shaded.inc"
 
etc.  They look just like C source code, so I do the obvious thing one would do with C source code - run them through a C compiler!  Just tell your compiler to only run the first preprocessor pass and save the output to the generated mapfile.
 
This gives you the benefits of #include syntax and avoids the need to reprocess everything for every map request - you just re-run your mapfile generation scripts each time you change something.
 
     - Ed
 
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 (978) 251-4242
Fax: +1 (978) 251-1396
ed at topozone.com 


________________________________

From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of McGraw, Joanne
Sent: Friday, June 03, 2005 8:51 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] "includes" in mapfiles?



Is there any syntax for including the contents of another file in a mapfile?

 

I have about 60+ layers that need to go online and most of them fall into fairly clear groups of five layers each. Based on their selection in a drop-down list, users will indicate the group of maps they are interested in looking at and the application will load that map file. There are, however, about 10 ancillary layers of data that should be available no matter what map is loaded (roads, hydro, cities, etc.). Rather than repetitively defining this information in every map file, is there any way I can define the ancillary layers in one file, and then simply load that file's contents from within the other map files?

 

I'm not sure what to call these except "includes." I haven't had any luck in the archive with that expression, but I cannot believe no one has wanted to do this before.

 

Cheers,

jtm

Joanne T. McGraw
Spatial Data Visualization Specialist / Spécialiste en visualisation des données spatiales
Agriculture and Agri-Food Canada / Agriculture et Agroalimentaire Canada
Telephone/Téléphone: (613) 759-6103
Facsimile/Télécopieur: (613) 759-1937
960 Carling Ave, #1136
Ottawa, Ontario
K1A 0C6

mcgrawj at agr.gc.ca

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050604/59680ada/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 3190 bytes
Desc: image001.jpg
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050604/59680ada/attachment.jpg>


More information about the MapServer-users mailing list