Opened 16 years ago
Closed 16 years ago
#2781 closed defect (fixed)
[PATCH] AlignInCircle fails and aligns nodes in a flat curve
Reported by: | pov | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
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)
by , 16 years ago
Attachment: | align.diff added |
---|
comment:2 by , 16 years ago
Cc: | added |
---|---|
Resolution: | fixed |
Status: | closed → 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.
by , 16 years ago
Attachment: | AlignInCircleAction.java.patch added |
---|
comment:3 by , 16 years ago
Summary: | AlignInCircle fails and aligns nodes in a flat curve → [PATCH] AlignInCircle fails and aligns nodes in a flat curve |
---|
comment:4 by , 16 years ago
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 by , 16 years ago
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.
patch