#10821 closed defect (fixed)
[PATCH] ImproveWayAccuracy produces self-intersecting ways
Reported by: | akks | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.11 |
Component: | Core | Version: | |
Keywords: | ImproveWayAccuracy | Cc: |
Description
Reported by Vitalts on forum:
http://forum.openstreetmap.org/viewtopic.php?pid=469490#p469490
How to reproduce:
- Open attached .osm file
- Enter Improve Way Accuracy mode
W
and hold
Ctrl
- Move mouse near the east node (see animated gif by Vitalts)
Self-intersecting ways are not expected to appear.
Solution:
There is some rounding error in sin/cos based Geometry.getSegmentAltituteIntersection (transferred from IWA
plugin? misprint also...)
The function does actually the same as closesPointTo
but returns null sometimes. It is used only in IWA mode and in NanoLog plugin.
- One solution is to remove this function and use closestPointToSegment and additional checks.
- Another solution is to keep separate function but use the code from closestPointToSegment (no other class changing will be neeeded, patch attached)
@team: could someone check the patch with the second solution?
Attachments (4)
Change History (13)
Changed 9 years ago by
Attachment: | IWAbug.osm added |
---|
Changed 9 years ago by
Attachment: | Improve Way Accuracy.gif added |
---|
Changed 9 years ago by
comment:1 Changed 9 years ago by
comment:3 Changed 9 years ago by
Yes, the misprint is also a problem :)
However, closestPointToSegment does not tell if the nearest point is inside the segment (extra unneeded operations to check?), so maybe the separate function is still needed...
comment:4 Changed 9 years ago by
If it's only used at one place in core and there the other function is better, then there is no reason to keep it except you find a good reason.
comment:5 Changed 9 years ago by
OK, then I'll delete the Geometry.getSegmentAltituteIntersection and fix call in NanoLog this evening.
The patch follows.
Changed 9 years ago by
Attachment: | iwa2.patch added |
---|
comment:6 Changed 9 years ago by
Otherwise ьeasurу the angle
Should be "Otherwise measure the angle". But ь isn't m in cyrillic. Simply a typo? :-)
comment:9 Changed 9 years ago by
Milestone: | → 14.11 |
---|
If it does the same, drop the function and fix plugin calls. Why keep a duplicate function?