Modify

Opened 16 years ago

Closed 16 years ago

#737 closed defect (fixed)

Validator plugin WronglyOrderedWays false error

Reported by: anonymous Owned by: framm
Priority: major Milestone:
Component: Plugin Version: latest
Keywords: valadator Cc:

Description

he validator plugin was giving a false error on a lake with a clockwise way. When I looked at the code, I found the code locates the most northern point of the way and then looks at the next point and if it is east of the north point the way is considered to be clockwise. In my case the northern point of the clockwise way was also the most eastern point so it considered the way counter-clockwise.

I have done a rewrite of the code as follows:

Determine the mean latitude of the closed way.
Then add the deltas of longitude for each segment starting with
a latitude greater than mean and subtract the deltas of longitude
if the start is less than the mean latitude.

The result should be positive for clockwise ways and negative
for counter-clockwise ways.

This may still incorrectly determine the direction of the way in some cases, but should be much more reliable then before.

I also noticed the validation error result labels were not correct and fixed this error.

Attached are my changes.

Attachments (1)

WronglyOrderedWays.diff (3.0 KB ) - added by anonymous 16 years ago.
way direction by pollygon area

Download all attachments as: .zip

Change History (4)

by anonymous, 16 years ago

Attachment: WronglyOrderedWays.diff added

way direction by pollygon area

comment:1 by anonymous, 16 years ago

Component: CorePlugin

comment:2 by anonymous, 16 years ago

I tried your patch, but it seems it makes the situation worser, not better. Is there a bug in your code or an error in your algorithm?

comment:3 by anonymous, 16 years ago

Resolution: fixed
Status: newclosed

Checked in modified patch.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.