Opened 4 years ago
Closed 4 years ago
#2781 closed defect (fixed)
[PATCH] AlignInCircle fails and aligns nodes in a flat curve
| Reported by: | pov | Owned by: | team |
|---|---|---|---|
| Priority: | major | Component: | Core |
| Version: | Keywords: | align circle | |
| Cc: | landwirt@… |
Description
Sometimes AlignInCircle fails to align nodes in circle and the result is a that the way is then flat and curvy. When it doesn't, the way is often moved around anyway. This is caused by the center calculation failing. The algorithm currently used is prone to that if some of the segments are aligned. I've re-implemented the center calculation and the result is now much better.
Attachments (3)
Change History (9)
Changed 4 years ago by pov
comment:1 Changed 4 years ago by stoecker
- Resolution set to fixed
- Status changed from new to closed
In r1713.
comment:2 Changed 4 years ago by Landwirt
- Cc landwirt@… added
- Resolution fixed deleted
- Status changed from closed to reopened
The new calculation is correct, but works only for large polygons and node clouds normally not used for OSM objects. Obviously not tested on real data. :-)
I changed the code to have more precision and also removed some dead code.
Changed 4 years ago by Landwirt
comment:3 Changed 4 years ago by Landwirt
- Summary changed from AlignInCircle fails and aligns nodes in a flat curve to [PATCH] AlignInCircle fails and aligns nodes in a flat curve
comment:4 Changed 4 years ago by pov
Not to criticize your patch, but I've corrected probably a hundred roundabouts using my patch version without problems. The only time it didn't work wasn't a rounding problem but because the polygon was looping and the algorithm doesn't work on looping polygons. I wanted to add a test with a warning dialog but failed to do it in 5 minutes and abandoned.
comment:5 Changed 4 years ago by Landwirt
Yeah, hadn't been that harsh on the not-testing-part, sorry. I corrected roundabouts myself with it. :-)
But the variant with the doubles doesn't work well with smaller areas, attached is an example with test cases. The values for area, east and north get so small that the result won't fit in a double without losing precision.
comment:6 Changed 4 years ago by stoecker
- Resolution set to fixed
- Status changed from reopened to closed
In r1768.



patch