[josm-dev] Validator plugin WronglyOrderedWays false error

Roy Rankin rrankin at ihug.com.au
Sun May 11 10:38:00 BST 2008


As attachments do not seem to work with the list I have attached my fix 
to trac report 737.

Regards,
Roy rankin

Roy Rankin wrote:
> The 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.
> 
> Regards,
> Roy Rankin
>           *
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> josm-dev mailing list
> josm-dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev




More information about the josm-dev mailing list