"includes" in mapfiles?

Florian Lohoff flo at RFC822.ORG
Sun Jun 5 14:12:33 EDT 2005


Hi,
i was just reading the thread in the archives. I had a similar problem.
A lot of layers, symbols etc - So i used "filepp" which is a cpp++ so
generate my map file. The problem with cpp is that its not capable of
expaning a macro with the newlines. filepp does that by giving "-lrn".

My main "map.cpp" looks like this:

#define __IMAGEURL "/tmp/"
#define __IMAGEPATH "/var/www/tmp/"

NAME firstmap
#include "map-head"
#include "scalebar"
#include "color"
#include "symbol"
#include "layer"
END

The good thing about using cpp/filepp is macros :)

#define macro_snt2(_func, _fer, _mscale, _snttype, _s1, _s2) \
        CLASS \
          EXPRESSION ([FUNCRDCL] eq _func && [FERTYP] eq _fer) \
          MAXSCALE _mscale \
          NAME snt_ ## _func ## _fer \
          STYLE \
            SYMBOL "circle" \
            SIZE _s1 \
            COLOR _snttype ## _OUTLINECOLOR \
          END \
          STYLE \
            SYMBOL "circle" \
            SIZE _s2 \
            COLOR _snttype ## _COLOR \
          END \
        END

So defining streets goes like this:

     macro_snt3(1, 0, 50000, _snt_type10_large, 9, 7, 1)

     macro_snt2(2, 0, 10000, _snt_type20_large, 9, 7)
     macro_snt2(2, 0, 25000, _snt_type20_large, 7, 5)
     macro_snt2(2, 0, 50000, _snt_type20_large, 6, 4)

     macro_snt2(4, 0, 10000, _snt_type40_large, 6, 4)
     macro_snt2(4, 0, 25000, _snt_type40_small, 4, 2)

     macro_snt2(3, 0, 10000, _snt_type30_large, 6, 4)
     macro_snt2(3, 0, 50000, _snt_type30_small, 4, 2)

Color definition are even in a different file.

Flo
-- 
Florian Lohoff                  flo at rfc822.org             +49-171-2280134
                        Heisenberg may have been here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050605/12e5238b/attachment.bin


More information about the mapserver-users mailing list