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)
Change History (4)
by , 16 years ago
Attachment: | WronglyOrderedWays.diff added |
---|
comment:1 by , 16 years ago
Component: | Core → Plugin |
---|
comment:2 by , 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?
way direction by pollygon area