[mapserver-users] LAYER LABEL ANGLE Calculation Problem

thomas bonfort thomas.bonfort at gmail.com
Sat Dec 27 12:12:27 EST 2008


you can let postgres calculate the angle for you:

DATA "geom FROM (select geom, toid, orientation/10-90 as orientation
from cartographictext) as foo  USING UNIQUE toid"

and then use
angle [orientation]
in your label

regards,
thomas

On Fri, Dec 26, 2008 at 18:36, Donald Kerr <donald.kerr at dkerr.co.uk> wrote:
> I am looking for some help if possible.
>
> I am putting labels on a map and the angle is stored in database field
> called "orientation". Orientation is in 10ths of degrees so I need to divide
> by 10 to get degrees. I also need to offset by 90 degrees as the number
> starts at east, not north. Ideally I would just like to do the following in
> the LABEL definition:
>
> ANGLE (([orientation]/10)-90)
>
> ... But it doesn't work - getting pink tiles.
>
> ANGLE [orientation] does work but obviously the labels are NOT at the right
> angle.
>
> Here's the full layer definition:
>
> LAYER CONNECTIONTYPE postgis
>        NAME "CartographicText"
>        CONNECTION "user=postgres dbname=MasterMap host=localhost"
>        DATA "geom FROM cartographictext USING UNIQUE toid"
>        STATUS DEFAULT
>
>        MINSCALEDENOM 1
>        MAXSCALEDENOM 1300
>
>        TYPE ANNOTATION
>
>        DEBUG ON
>
>        LABELITEM textstring
>        CLASS
>                EXPRESSION ([featurecode] = 10169)
>                LABEL
>                        TYPE truetype
>                        FONT arial
>                        SIZE 6
>                        COLOR  0 0 0
>                        OUTLINECOLOR 255 255 255
>                        BACKGROUNDCOLOR 255 0 0
>                        ANTIALIAS TRUE
>                        ANGLE [orientation]
>                END # LABEL
>        END # CLASS
> END # LAYER
>
>
> 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