[Mapserver-users] metadata object?

Sean Gillies sgillies at frii.com
Sat Sep 6 09:45:08 PDT 2003


On Saturday, September 6, 2003, at 09:49  AM, Michael Schulz wrote:

> Hi,
> what would be the correct way to access the metadata of map and layer 
> objects via mapscript, if you don't know the names of the metadata 
> properties?
>
> Is there a function like getMetaData(), that doesn't take a name but 
> returns a list of all metadata entries for the object?
> Just curious.
>
> Cheers, Michael
>

Hi Michael,

I've thought about this a lot.  My particular need was to access the 
hash
of fonts through something like

fonts = mapobj.fontset.getFonts()
fonts
['Arial','ArialHB',...]

I had this working, but then some other changes to the MapServer code 
broke
my code, and then things got too hectic before the 4.0 release ... I 
ended
up removing my work from the CVS.

Metadata are stored in a hashTableObj, but unfortunately there seems to 
be
problems between this code and SWIG with the result that a hashTableObj
can't yet be exposed in MapScript.  Ideally we want hashTableObjs with
methods like keys(), has_key(), &c.

Enter this as a feature request in the MapServer Bugzilla and I'll help 
you
lobby for work on it.  I think it will require a re-write of the code in
maphash.c to make it SWIG compatible or require some work on the SWIG 
code
itself.

Meanwhile, I think you'll have to write some code to parse the mapfile 
and
get the metadata keys.

cheers,
Sean



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




More information about the MapServer-users mailing list