From e891ffa5d197f5a02ea2436a179e020dd9d4f59e Mon Sep 17 00:00:00 2001 From: map-per Date: Sat, 8 Nov 2025 13:05:46 +0100 Subject: [PATCH] [editor] compare coordinates with tolerance and in WGS 84 Signed-off-by: map-per --- libs/editor/osm_editor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/editor/osm_editor.cpp b/libs/editor/osm_editor.cpp index 97b6b3425..e28295c69 100644 --- a/libs/editor/osm_editor.cpp +++ b/libs/editor/osm_editor.cpp @@ -647,7 +647,11 @@ void Editor::UploadChanges(string const & oauthToken, ChangesetTags tags, Finish try { XMLFeature osmFeature = changeset.GetMatchingNodeFeatureFromOSM(objCreateData.mercator); - if (objCreateData.mercator == osmFeature.GetMercatorCenter()) + + // precision of OSM coordinates (WGS 84), ~= 1 cm + constexpr double tolerance = 0.0000001; + + if (AlmostEqualAbs(feature.GetCenter(), osmFeature.GetCenter(), tolerance)) { changeset.AddChangesetTag("info:merged_same_location", "yes"); feature = osmFeature;