How to calculate Azimuth from Angle in map file?
Richard Greenwood
richard.greenwood at GMAIL.COM
Mon Aug 20 15:05:53 PDT 2007
On 8/20/07, Brent Fraser <bfraser at geoanalytic.com> wrote:
> Mapservites,
>
> I've got shapefiles with angle values (0 degrees =
> positive X axis, increasing counter clockwise) but
> Mapserver uses azimuths ( 0 = positive Y axis, increasing
> clockwise) when rotating symbols.
>
> Is there any way to calculate azimuth from angle in the
> map file? I don't want to modify the dbf portions of the
> shapefile if I don't have to; there's 13,000 of them, and I
> may get updates so maintenance could be a pain.
>
> It would be nice if I could do something like:
>
> STYLE
> SYMBOL "pt_Building"
> ANGLE (90 - [angle]) # this doesn't work, so don't
> try it!
> COLOR 80 80 80
> END
>
> Any ideas?
>
> Brent Fraser
> GeoAnalytic Inc.
> Calgary, Alberta
Not sure if this will work in a map file, but the formula I use to
convert "mathematical" angles to azimuths is:
azimuth = (450-m) - int( (450-m) / 360 ) * 360
where "m" is the "mathematical" angle.
--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com
More information about the MapServer-users
mailing list