No subject
Mon Oct 7 05:54:23 PDT 2024
==================
The short answer is no, there is no map file keyword to indicate the field
to use as the rotation value.
The long answer is there are a couple of work-arounds that might work for
you:
1. Use LABEL with POSITION CC and LABELANGLEITEM to indicate the field with
the rotation
- if you want to have a text label along with the "symbol" then
you'll to define another LAYER just for that
- this will only work for using TrueType fonts for symbols (it won't
work for Bitmap or Vector symbols)
OR
2. Create different symbols for the different directions, and then use CLASS
and EXPRESSION to assign the appropriate symbol for the different values in
the field.
- We used this method to show ship symbols based on a "heading"
attribute:
CLASS
EXPRESSION ([HEADING]<23 or [HEADING]>337)
SYMBOL 'arrowup'
SIZE 10
COLOR 255 0 0
OUTLINECOLOR 0 0 0
END # CLASS
CLASS
EXPRESSION ([HEADING]>=23 and [HEADING]<67)
SYMBOL 'arrowuprt'
:
In this case we generalized the heading values to eight different symbols
representing eight points on a compass.
============================
Brent Fraser
----- Original Message -----
From: "Jørn Vegard Røsnes" <jorn at SPACETEC.NO>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Thursday, March 23, 2006 1:46 PM
Subject: [UMN_MAPSERVER-USERS] Arrow for a line
> Hi,
>
> I have a Postgis database with some lines and the heading of them (track
of
> vessels).
> How can I use ANGLEITEM to visualise the heading of the boats, preferrably
> with an arrow?
>
> Here is an example I know doesn't work, maybe close to the solution....:
>
> SYMBOL
> NAME 'dashed1'
> TYPE VECTOR
> POINTS
> 0 0
> 0 1
> -99 -99
> 0 0
> 0.3 0.3
> -99 -99
> 0 0
> -0.3 0.3
> END
> FILLED false
> END
>
> LAYER
> NAME "ais"
> CONNECTIONTYPE POSTGIS
> CONNECTION "user=postgres dbname=havo host=localhost port=5432"
> DATA "track from my_ship_track_view"
> TYPE line
> PROJECTION
> "init=epsg:4326"
> END
> LABELITEM "name"
> CLASSITEM "name"
> CLASS
> STYLE
> ANGLEITEM 'heading'
> SYMBOL "dashed1"
> SIZE 20
> COLOR 0 255 0
> END
> END
>
> CLASS
> DEBUG ON
> LABEL
> COLOR 132 31 31
> SHADOWCOLOR 218 218 218
> SHADOWSIZE 2 2
> TYPE TRUETYPE
> FONT arial
> SIZE 5
> ANTIALIAS TRUE
> POSITION CL
> PARTIALS true
> MINDISTANCE 10
> BUFFER 4
> END # end of label
> COLOR 224 64 0
> END
> END
>
>
> cheers
> Jorn
More information about the MapServer-users
mailing list