openstreetmap/iD — pull request #2122 by tyrasd (2014-02-09 18:13:48+00:00)
Title: Fix bugs in polygon merge operation

The merge operation for polygons currently exhibits two major issues:

tag merging
---------------

When merging an existing multipolygon with another area, the final multipolygon gets all tags from all subareas (including uninvolved inner polygons, uninvolved outer lines, etc.).

Example: A forest (landuse=forest) containing some clearings (`landuse=meadow`), whose outline is in part a river (`waterway=river`) is merged with a new untagged area. The resulting multipolygon is tagged: as `landuse=forest;meadow` + `waterway=river`

http://master.apis.dev.openstreetmap.org/relation/4294970112

incomplete relations
-------------------------

When merging only partially loaded multipolygon relations, unloaded parts are dropped from the resulting multipolygon. Moreover, the merging algorithm relies on completely loaded relations to determine inner/outer status of the involved areas.

http://master.apis.dev.openstreetmap.org/relation/4294970111/history

--

This PR should fix both of those problems. The first by only moving tags to the multipolygon relation from newly added outer polygons, the second by disabling the merge operation if at least one of the involved relations is not fully loaded.