[Mapserver-dev] Proposal for mapfile IO changes for MapServer 4.1

Sean Gillies sgillies at frii.com
Wed Jul 2 12:33:03 EDT 2003


I'd like to proposal a change to the manner in which mapfiles
are read and written for 4.1.  My proposed changes would enable
us to write and load mapfile fragments.  Would love to hear
what you think of this proposal.

To start, I'd like to see msLoadMap() overhauled so that all
the work is performed by a msLoadMapString() function.  Then
we could reduce msLoadMap() to something like the following

     fh = open(filename)
     map_string = fh.read()
     map = msLoadMapString(map_string)

I'd also like to see this extended to layers, classes, etc.
It would be really handy to take an existing map and then
add a layer defined in a string like in this mapscript

layer_string = 'NAME "foo"\nTYPE POLYGON\n' # for example
layerobj = layerObj(mapobj, layer_string)

An msLoadLayerString() function would be used in this new layerObj

As well, I'd like to see *writeString() functions for map, layer,
classes, and have msSaveMap() rewritten to call these.


More information about the mapserver-dev mailing list