﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10744	[patch proof-of-concept] Ease Multipolygon-Creation and Handling if selection overlaps ways that already take part in another MP	cmuelle8	team	"The current work with MP in josm is still far from perfect. This patch tries to ease the pain by deploying the possibility to automatically reuse way segments that overlap with the ways selected when a multipolygon is about to be created (Strg+B in most installations).

The algorithm evaluates each way segment to find overlapping ways that already take part in a multipolygon relation.  It calculates split points and automatically splits or directly reuses these ways to build the current multipolygon.  As a result, the overlapping way segments of the selection are deleted and filled with the reusable ones found.  This means, the resulting multipolygon consists of ways directly shared with the adjacent multipolygon areas found.

In an area well mapped with MP this patch unifies the creation of new areas to some extent: If a closed way is drawn iteratively, and overlaps many ways that take part in other MPs, then, if Strg+B is hit, the result will ultimately be the same as selecting the single outer way one by one and using Strg+B on this selection.  Effectively, this enables the choice to map simple MPs like closed ways.

Atm this is just a proof-of-concept with an invitation to comment and test.

It's not ready for production yet. Todo:

* relevant code block should be split into several functions and maybe merged to a different code spot
* stuff all actions into a sequence command - atm necessary split ops and deletions are pushed directly to the undo stack - for production use only one command in the edit history should be occupied
* lack of documentation


If you find unexpected, reproducable behavior, please attach test data to this ticket. (Please ignore EDT warnings that are thrown when the result of a notification is drawn from a non-gui thread. SplitWayAction should be patched to not throw any EDT, but CreateMultipolygonAction still has some places that seem to wrongly use EDT.)

Greetings"	enhancement	new	normal		Core	latest		multipolygon	
