dynamic symbol name

Hiten Ravani Hiten.Ravani at ADAPTIVESYSTEMS.COM.AU
Wed Mar 9 23:17:30 PST 2005


Hi all,

I am accessing a layer through postgres/postgis database. The layer is about
different cities and their minimum and maximum temperatures. I would like to
display city name, min/max temperature and weather icon symbol for major
cities.

I have no troubles displaying the city name, min/max temperatures using the
following

text([location] [min]/[max])



The problem I am having is the icon id for symbol is stored in the database
and the data is updated every hour depending on the min/max temperatures for
that place, hence i cannot hard code the value of weather icon id in the
mapfile (since icon id could be sunny then later rainy etc). In order to
display that symbol i use

symbol [integer|string|filename] => symbol 'sunny'

sunny is the value i get from the database and the symbol file has reference
to sunny.gif image. But i do not know how to dynamically substitute the
value passed to symbol, i mean is there anyway to set a value i get from the
database?

I tried symbol ([icon]) , but it didn't work. (icon is attribute name of
column in db)

One more question.For min/max temperatures if one of them is unavailable the
value in the database is stored as -99, and so say the min temp is
unavailable for a city then when i display that value on map it gets
displayed as -99/26. (min/max)

Is there a way that in my map file if min or max temp is equal to -99 then
display '-' on the map instead of showing -99 ? i.e -/26

I am using php mapserver 4.4.1 and chameleon 2.0.

I thought of achieving the above using php-mapscript, but since i am using
chameleon , i will have to dig in their code , so it would be best if it is
possible to do it in mapfile itself.

Any help is greatly appreciated.

Thanks,

Regards,
Hiten Ravani.



More information about the MapServer-users mailing list