read up the mapfile

Huub Fleuren hfl at HOME.NL
Fri Sep 2 14:51:20 EDT 2005


Okay,
This is a rudimentary include for the actual labour pre-preprocessing fase
works with awk (on windows with awk95, a 32bit version of awk (long names))
http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe

any (recursive) perl code can do the same

t'is run by

awk95 -f include.awk  
your_main_map_template.map_stuffed_with_INCLUDE_filenames

example mapfile

MAP
  INCLUDE include_files.txt
  INCLUDE web.txt
  INCLUDE legend.txt
  INCLUDE scalebar.txt
  INCLUDE first.layer
  INCLUDE second.layer
  INCLUDE third.layer
  #INCLUDE not_this.layer
END
layers 1,2 and 3 could INCLUDE a_common.class


*file contents : include.awk*
BEGIN {
    OUTPUT = "my.map"
    while ((error = getline) == 1) {
        gsub(/^.*[I]/,"I")
        if ($1 == "INCLUDE") {
            print "#"$2 >> OUTPUT
            system ("awk95 -f include.awk " $2)
        } else {
            print $0 >> OUTPUT
        }
    }
}


Regards, Huub



More information about the mapserver-dev mailing list