Modify

Opened 5 years ago

Closed 4 years ago

#1652 closed enhancement (fixed)

[PATCH] JOSM should have a feature to join two areas

Reported by: xeen Owned by: xeen
Priority: minor Component: unspecified
Version: latest Keywords:
Cc:

Description

Currently you have to:
1) Add new nodes where both areas cross/start to overlap
2) Delete all nodes that reach into either of the areas "inner" (i.e. the ones between the two new nodes created in step one)
3) Disconnect the shared part of the way for both areas and delete it
4) Join the ways

An automated feature could save quite some time, although I'm not sure how easy it is to determine the nodes in step 1 and 2.

Attachments (4)

joinareas.png (328 bytes) - added by xeen 4 years ago.
JoinAreasFunction.patch (57.8 KB) - added by xeen 4 years ago.
Includes TestFile.osm, JoinAreas.java and changes to UtilsPlugin.java
JoinAreasFunction new.patch (58.0 KB) - added by xeen 4 years ago.
Fixeda
JoinAreasFunction with support for adjacent areas.patch (65.8 KB) - added by xeen 4 years ago.
Fixing is hard

Download all attachments as: .zip

Change History (9)

comment:1 Changed 5 years ago by anonymous

May be we should combine all three "join" functions (join nodes, ways, areas) in one tool/action? Which function is executed depends then on the objects selected.

comment:2 Changed 4 years ago by xeen

  • Owner changed from framm to xeen

I'm working on this and it basically works, just need to add tag/relations/non-downloaded stuff checking. Well, and a /lot/ of testing.

Changed 4 years ago by xeen

Changed 4 years ago by xeen

Includes TestFile.osm, JoinAreas.java and changes to UtilsPlugin.java

comment:3 Changed 4 years ago by xeen

  • Summary changed from JOSM should have a feature to join two areas to [PATCH] JOSM should have a feature to join two areas

The patch depends on ExtendedDialog.java (can't find the revision where it was committed, but a rather recent one).

It modifies the utils plugin to add the functionality. I checked it against all cases that I could come up with (they are included in the test file) and it works for them, maybe there are more. It will produce relations with errors though if the selection makes no sense, which is most often the case when I wouldn't know how to join the areas if I had to do it manually.

It warns the users of being experimental, but hopefully no new bugs turn up :). It currently uses some hacks that allow it to take advantage of already-written code in CombineWayAction or SplitWaysAction. This could be changed in a later version to allow "nicer" access, if anyone cares. Currently my focus is on making it work for most cases, the how can still be refined later.

Changed 4 years ago by xeen

Fixeda

Changed 4 years ago by xeen

Fixing is hard

comment:4 Changed 4 years ago by xeen

I added a few fixes/checks so that adjacent areas (i.e. areas that share nodes) can be joined properly as well. I updated the testfile.

comment:5 Changed 4 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

Applied in 13723.

I like it. Even multipolygon support. Nice.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.