Opened 17 years ago

Closed 15 years ago

#2363 closed enhancement (wontfix)

Provide a method to specify angles as being clockwise

Reported by: nf Owned by: sdlime
Priority: normal Milestone:
Component: MapServer C Library Version: 5.0
Severity: normal Keywords: rotation angle
Cc:

Description

We are producing a number of meteorological products to be served via mapserver. The data is stored in shapefile format. Some of these products - in particular winds - have a bearing associated with them (e.g. 20kt winds coming from 43degrees). These angles are measured in a clockwise orientation from true north.

Mapserver's ANGLE parameter assumes that the value is in a counterclockwise direction. This causes the wind icons to be incorrectly oriented.

I have created a simple patch (attached) which changes mapserver to assume a clockwise rotation instead. As it stands, it is not suitable for inclusion in the trunk, as it is not backwards-compatible. One option would be to add a new directive to the .map file such as ANGLEDIRECTION, which would default to "CCW", but could be set to "CW".

If the above enhancement is acceptable to the mapserver community, I am willing to put more work into creating an ANGLEDIRECTION parameter, if required.

I do not believe this is a major change to mapserver's behaviour, so I am entering this here, rather than creating an RFC. If this is incorrect, please tell me and I'll create an RFC.

Attachments (1)

patch.diff (277 bytes ) - added by nf 17 years ago.
Patch to hard-code clockwise orientation of ANGLE values

Download all attachments as: .zip

Change History (3)

by nf, 17 years ago

Attachment: patch.diff added

Patch to hard-code clockwise orientation of ANGLE values

comment:1 by tbonfort, 17 years ago

I don't think this should be incorporated to mapserver. In my opinion, angles are treated as they should be, as the rules of trigonometry accepted by all have defined that positive angle values refer to anticlockwise directions.

I think this is more a preprocessing step of your data values, that can either be done when you create your data, or on the fly if you're using postgis for example

DATA "the_geom from 
    (SELECT gid, the_geom, (-angle) AS angle FROM mytable)
    as foo using unique gid"

comment:2 by sdlime, 15 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.