Modify

Opened 16 years ago

Closed 15 years ago

#1652 closed enhancement (fixed)

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

Reported by: xeen Owned by: xeen
Priority: minor Milestone:
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 15 years ago.
JoinAreasFunction.patch (57.8 KB ) - added by xeen 15 years ago.
Includes TestFile.osm, JoinAreas.java and changes to UtilsPlugin.java
JoinAreasFunction new.patch (58.0 KB ) - added by xeen 15 years ago.
Fixeda
JoinAreasFunction with support for adjacent areas.patch (65.8 KB ) - added by xeen 15 years ago.
Fixing is hard

Download all attachments as: .zip

Change History (9)

comment:1 by anonymous, 16 years ago

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

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.

by xeen, 15 years ago

Attachment: joinareas.png added

by xeen, 15 years ago

Attachment: JoinAreasFunction.patch added

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

comment:3 by xeen, 15 years ago

Summary: JOSM should have a feature to join two areas[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.

by xeen, 15 years ago

Attachment: JoinAreasFunction new.patch added

Fixeda

comment:4 by xeen, 15 years ago

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

Resolution: fixed
Status: newclosed

Applied in 13723.

I like it. Even multipolygon support. Nice.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain xeen.
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.