Skip to content

Commit

Permalink
Keep non-conflicting tags when merging data, see JOSM #23555
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Mar 22, 2024
1 parent d35dfd9 commit 0040a87
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -230,8 +232,10 @@ public static List<Command> 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);
Expand Down

0 comments on commit 0040a87

Please sign in to comment.