[Mapserver-dev] CONFIG Keyword

Sean Gillies sgillies at frii.com
Sun Mar 14 10:29:18 EST 2004


On Mar 13, 2004, at 1:32 PM, Frank Warmerdam wrote:

> Folks,
>
> I have added the CONFIG keyword for use in the MAP object in a .map  
> file.
> It takes two arguments, a key and a value.  The PROJ_LIB key will  
> attempt to
> force PROJ.4 to use the provided value for looking up files like the  
> epsg
> file, and the datum shift files.
>
> I am hoping that setting the PROJ_LIB variable will be the main use of
> this keyword for most people, helping them avoid having to set external
> environment variables.
>
> Any other value will be passed on to CPLSetConfigOption().  This  
> provides
> customized control of some GDAL and OGR driver behaviours.   Details on
> such options would be found in specific GDAL driver documentation.  My  
> main
> reason for implementing all this is because it is needed for  
> controlling some
> behaviour of the OGR DODS driver.
>
> In addition to adding the CONFIG keyword in map file parsing, I also  
> add
> a setConfigOption() and getConfigOption() method in mapscript.i, and  
> documented
> them in mapscript.txt.  I even tested them briefly in a python  
> mapscript script.
> I am getting the hang of MapScript!
>
> I haven't updated the mapfile reference yet, but I intend to do that  
> soon.
>
> Changes all committed.  Whack me if I screwed something up.
>
> Best regards,
> --  
> --------------------------------------- 
> +--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,  
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>

Frank,

I have a suggestion: to use, perhaps, MapServer's hashTableObj  
structure for
the config instead of a pair of string arrays?  One of these days I am  
going
to figure out how we can expose MapServer's hashes to SWIG and then we  
will
be able to drop the setOption/getOption methods in favor of

    mapobj.config['foo'] = 'bar'
    layerobj.metadata['wms_title'] = 'wms layer'

Could you also update the msCopyMap function in mapcopy.c so that it  
properly
replicates your new mapObj structure members?

Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies




More information about the mapserver-dev mailing list