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

Paul Spencer spencer at dmsolutions.ca
Wed Jul 2 12:52:15 EDT 2003


I like this idea, it is something that I wanted for supporting MapEdit 
development.  The workaround that we use is to save a temporary copy of 
the mapfile and use msLoadMap( filename, path_to_use ) where path_to_use 
provides a way of telling mapserver to *think* it loaded the mapfile 
from elsewhere.  This would eliminate two file IO steps and remove a 
bunch of hairy logic.

Cheers,

Paul

Sean Gillies wrote:
> Hi,
> 
> 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
> pseudocode:
> 
> msLoadMap(filename)
> {
>     ...
>     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
> constructor.
> 
> As well, I'd like to see *writeString() functions for map, layer,
> classes, and have msSaveMap() rewritten to call these.
> 
> cheers,
> Sean
> 
> 
> 
> _______________________________________________
> Mapserver-dev mailing list
> Mapserver-dev at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-dev
> 

-- 
Paul Spencer
Applications and Software Development
DM Solutions Group Inc.
http://www.dmsolutions.ca





More information about the mapserver-dev mailing list