[editor] compare coordinates with tolerance and in WGS 84

Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
map-per
2025-11-08 13:05:46 +01:00
parent 8799c5613e
commit e891ffa5d1

View File

@@ -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;