Modify

Opened 15 years ago

Closed 15 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)

align.diff (2.2 KB ) - added by pov 15 years ago.
patch
AlignInCircleAction.java.patch (7.4 KB ) - added by Landwirt 15 years ago.
#2.osm (8.0 KB ) - added by Landwirt 15 years ago.
examples

Download all attachments as: .zip

Change History (9)

by pov, 15 years ago

Attachment: align.diff added

patch

comment:1 by stoecker, 15 years ago

Resolution: fixed
Status: newclosed

In r1713.

comment:2 by Landwirt, 15 years ago

Cc: landwirt@… added
Resolution: fixed
Status: closedreopened

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 Landwirt, 15 years ago

comment:3 by Landwirt, 15 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 pov, 15 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 Landwirt, 15 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.

by Landwirt, 15 years ago

Attachment: #2.osm added

examples

comment:6 by stoecker, 15 years ago

Resolution: fixed
Status: reopenedclosed

In r1768.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.