[mapserver-users] LABEL - POSITION and FONT Calculations
Steve Lime
Steve.Lime at dnr.state.mn.us
Mon Dec 29 13:41:36 PST 2008
Here's one:
DATA "point FROM (select *, OID, substring(station from 2) as station_no_char, (case when current is null or tstamp_24hr is null or (now()-tstamp) > interval '1 day' then 0 when current > tstamp_24hr then 1 when current < tstamp_24hr then 2 else 3 end) as trend from station_interval_series where var=232) as foo USING UNIQUE OID USING SRID=-1"
I create a trend column based on time intervals. Output is 0, 1, or 3.
Steve
>>> On 12/29/2008 at 3:34 PM, in message <5D58F8CE57F74F1BAC6E294D610ECC1C at DELL>,
"Donald Kerr" <donald.kerr at dkerr.co.uk> wrote:
> Steve,
>
>>> The question is: Is it possible to take the values from the database and
>>> convert them for use within the LABEL e.g. 2 = ul = "POSITION ul" or 5 =
> uc
>>> = "POSITION uc"?
>
>> At the moment POSITION is not bindable. If you file a bug then that can be
> changed. Once changed
>> you could use a PostgreSQL case statement to map your position codes to
> MapServer values (e.g.
>> 1 => UL or whatever).
>
>>> I would also like to be able to change the Font based on [fontnumber]
> from
>>> the database e.g. 0 = Arial = "FONT arial" or 1 = Times = "FONT times"
>
>> Fonts are bindable so you'd just need a case statement to map your codes
> to font names that
>> MapServer recognizes.
>
>
> Is it possible to create the case statement in MapServer e.g. "SELECT Geom
> FROM (<CASE SELECT IN HERE>) USING UNIQUE oid"?
>
> If you have any experience of doing this can you pen a quick example for me
> please?
>
> Many thanks.
>
> Regards,
>
> Donald
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list