Symbol rotation via attribute lookup

Richard Orth - osmoGIS Incorporated rco at OSMOGIS.COM
Fri Sep 23 02:48:24 EDT 2005


Two things to try
1. Place a LABEL to display the value of 'heading'.
2. Check the attributes of the 'heading' field in PostGIS, is it a 
string, integer, float, double, etc... ANGLEITEM may need to be a 
non-string to work.

Hope this helps.

Richard C Orth

Michael Underwood wrote:

> Hello,
> I'm using PHP/MapScript 4.6 and trying to create a layer of points 
> from a PostGIS database using an arrow pointing in the direction of 
> the 'heading' field in the data table.  No matter what I try though, I 
> get a map with all of the arrows pointing straight up (i.e. 
> unrotated).  My definitions include a TrueType symbol using a 
> character of an arrow pointing up (I've also tried drawing an arrow as 
> a Vector symbol with the same results):
>
>   SYMBOL
>     NAME 'trackarrow'
>     TYPE TRUETYPE
>     FONT 'adings'
>     FILLED false
>     ANTIALIAS false
>     CHARACTER 'a'
>   END
>
> A layer with the following data source:
>
>   DATA "vessel_coordinate from (select * from archive_v where 
> vessel_id=12) as foo using unique myoid using SRID=-1"
>
> A class to size, colour and (in theory) rotate the symbol:
>
>   CLASS
>     SYMBOL 'trackarrow'
>     SIZE 12
>     STYLE
>       COLOR 0 0 0
>       ANGLEITEM 'heading'
>     END
>   END
>
> I know that the ANGLEITEM line is being read by MapServer because if I 
> change the name in quotes I get an error that the field doesn't exist, 
> and if I try putting the field name in square brackets I get parsing 
> errors, but setup like this I simply get all of the arrows size 
> twelve, coloured black, but pointing up.  The table contains thousands 
> of records with values in the heading field ranging from 0 to 359.
>
> Any insight into why the arrows won't rotate and how to make them do 
> so would be greatly appreciated.
> Thanks,
> Mike



More information about the mapserver-users mailing list