Modify

Opened 6 years ago

Closed 6 years ago

#8851 closed defect (fixed)

Bug when combining building segments.

Reported by: Grillo Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: combine, building Cc:

Description

I have encountered this bug several times. It happens when I combine several building segments into one. Suddenly one or more of the ways flies away in one of the directions of the building. I'm using the building tools plugin, and usually draw the seperate parts of the building with one of the marked so it follows the same angle. From what I have collected, it might have to do with some node going a bit out of the completed polygon, if that makes sense.

Before combining
Before combining, zoomed in
After combining, zoomed out
After combining, zoomed in

This doesn't happen every time though. First time in this instance it bugged and I undid the edit. Then I thought I'd report it and it worked fine. Third time it bugged again. I use the buildingtools plugin, but I think this bug has more to do with the combine feature.

Attachments (5)

building bug segments.osm (583.9 KB) - added by Grillo 6 years ago.
osm file, look for starvägen to find it
minimum.osm (1.8 KB) - added by akks 6 years ago.
absolute_minimum.osm (1.4 KB) - added by akks 6 years ago.
better_intersections.patch (5.1 KB) - added by akks 6 years ago.
hard_case.osm (3.2 KB) - added by akks 6 years ago.
one strange case that gives extra hole after joining. Is it OK?

Download all attachments as: .zip

Change History (18)

Changed 6 years ago by Grillo

Attachment: building bug segments.osm added

osm file, look for starvägen to find it

comment:1 Changed 6 years ago by anonymous

Addition: Edited with JOSM/1.5 (5990 sv) in Windows 7, if it makes a difference.

comment:2 Changed 6 years ago by Don-vip

Component: CorePlugin building_tools
Owner: changed from team to Upliner

comment:3 Changed 6 years ago by akks

This is not BuildingTools bug, as seems from description. Author forgot to mention he press Shift-J after drawing buildings.

This bug is reproducible, but zoom-dependent. It has to do something with intersection of parallel segments, I'm having a look...

Changed 6 years ago by akks

Attachment: minimum.osm added

comment:4 Changed 6 years ago by akks

Though if BuildingTools did not create such messy geometry, where would be no such bug...

comment:5 Changed 6 years ago by AlfonZ

Also it seems the result is selection-order-dependent.

  1. Select left rectangle, then add top one, then bottom one, the result is OK.
  2. Select top rectangle, then add bottom one, then left one, the result is as on the picture (one line sticking out to the left, one downwards).
  3. Select bottom rectangle, then top one, then left one, the result is different again (one line sticking out downwards).

Similar result (new nodes at weird places) can be obtained by Shift-I (utilsplugins2's Add nodes at intersections).

comment:6 Changed 6 years ago by akks

You were faster :)
Yes, Geometry.addIntersections is the source of the problem. Shift-I (Utilsplugin2) is creating the same buggy nodes .

comment:7 Changed 6 years ago by Don-vip

Component: Plugin building_toolsCore
Owner: changed from Upliner to team

Changed 6 years ago by akks

Attachment: absolute_minimum.osm added

Changed 6 years ago by akks

Attachment: better_intersections.patch added

comment:8 Changed 6 years ago by akks

Here is the patch that seems to fix the particular problem.
@team: It involves significant change in widely-used geometric function. It seems to work, eliminate bug and even give some speed-up, but could someone please check it before committing in stabilization phase?

I tested Shift-J on
http://josm.openstreetmap.de/browser/josm/trunk/data_nodist/Join_Areas_Tests.osm
and find it behavior weird enough, with or without the patch...

Last edited 6 years ago by akks (previous) (diff)

Changed 6 years ago by akks

Attachment: hard_case.osm added

one strange case that gives extra hole after joining. Is it OK?

comment:9 Changed 6 years ago by Don-vip

This looks ok, I did not see any regression :) The last strange case is already weird with current version.

comment:10 Changed 6 years ago by akks

In 6049/josm:

see #8851: fix some bugs in joining areas and adding intersections ("random nodes added")
(changed segment-segment intersection to more stable procedure)

comment:11 Changed 6 years ago by Don-vip

this bug is fixed, no ?

comment:12 Changed 6 years ago by akks

For now, yes... Let us leave "hard cases" for new tickets after tested :)

comment:13 Changed 6 years ago by akks

Resolution: fixed
Status: newclosed

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.