From 0040a87c95d45fef084a913cee409e0173280721 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Thu, 21 Mar 2024 14:28:50 -0600 Subject: [PATCH] Keep non-conflicting tags when merging data, see JOSM #23555 Signed-off-by: Taylor Smock --- .../plugins/conflation/command/ConflateMatchCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/openstreetmap/josm/plugins/conflation/command/ConflateMatchCommand.java b/src/org/openstreetmap/josm/plugins/conflation/command/ConflateMatchCommand.java index 3fbf110..60a2d1a 100644 --- a/src/org/openstreetmap/josm/plugins/conflation/command/ConflateMatchCommand.java +++ b/src/org/openstreetmap/josm/plugins/conflation/command/ConflateMatchCommand.java @@ -38,6 +38,7 @@ import org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry.ReplaceGeometryException; import org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry.ReplaceGeometryUtils; import org.openstreetmap.josm.tools.ImageProvider; +import org.openstreetmap.josm.tools.Logging; import org.openstreetmap.josm.tools.UserCancelException; import org.openstreetmap.josm.tools.Utils; @@ -195,7 +196,8 @@ public static Command buildReplaceGeometryCommand(OsmPrimitive subjectObject, Os TagMap savedSubjectTags = saveAndRemoveTagsNotInCollection(subjectObject, tagCollection); Command command = null; try { - command = ReplaceGeometryUtils.buildReplaceCommand(subjectObject, referenceObject); + command = ReplaceGeometryUtils.buildReplaceCommand(subjectObject, referenceObject, + CombinePrimitiveResolverDialog.Strategy.KEEP_NON_CONFLICTING); } catch (ReplaceGeometryException ex) { AutoScaleAction.zoomTo(Arrays.asList(subjectObject, referenceObject)); JOptionPane.showMessageDialog(MainApplication.getMainFrame(), @@ -230,8 +232,10 @@ public static List buildTagMergingCommand(SimpleMatch match, SimpleMatc return CombinePrimitiveResolverDialog.launchIfNecessary( match.getMergingTagCollection(settings), Arrays.asList(match.getReferenceObject(), match.getSubjectObject()), - Collections.singleton(match.getSubjectObject())); + Collections.singleton(match.getSubjectObject()), + CombinePrimitiveResolverDialog.Strategy.KEEP_NON_CONFLICTING); } catch (UserCancelException e) { + Logging.trace(e); return null; } finally { restoreRelationsData(savedRelationsData);