diff --git a/editor/editor_tests/osm_feature_matcher_test.cpp b/editor/editor_tests/osm_feature_matcher_test.cpp
index d0a8361b6c..8299ca4754 100644
--- a/editor/editor_tests/osm_feature_matcher_test.cpp
+++ b/editor/editor_tests/osm_feature_matcher_test.cpp
@@ -263,6 +263,8 @@ char const * const osmRawResponseRelation = R"SEP(
)SEP";
} // namespace
+// Note: Geometry should not contain duplicates.
+
UNIT_TEST(GetBestOsmNode_Test)
{
{
@@ -277,8 +279,8 @@ UNIT_TEST(GetBestOsmNode_Test)
pugi::xml_document osmResponse;
TEST(osmResponse.load_buffer(osmRawResponseNode, ::strlen(osmRawResponseNode)), ());
- auto const bestNode = osm::GetBestOsmNode(osmResponse, ms::LatLon(53.8978398, 27.5579251));
- TEST(bestNode, ());
+ auto const bestNode = osm::GetBestOsmNode(osmResponse, ms::LatLon(53.8977254, 27.5578377));
+ TEST_EQUAL(bestNode.attribute("id").value(), string("277172019"), ());
}
}
@@ -352,3 +354,64 @@ UNIT_TEST(GetBestOsmRealtion_Test)
auto const bestWay = osm::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST_EQUAL(bestWay.attribute("id").value(), string("365808"), ());
}
+
+namespace
+{
+char const * const osmResponseBuildingMiss = R"SEP(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+)SEP";
+} // namespace
+
+UNIT_TEST(HouseBuildingMiss_test)
+{
+ pugi::xml_document osmResponse;
+ TEST(osmResponse.load_buffer(osmResponseBuildingMiss, ::strlen(osmResponseBuildingMiss)), ());
+ vector const geometry = {
+ {-0.2048121407986514, 60.333984198674443},
+ {-0.20478800091734684, 60.333909096821458},
+ {-0.20465925488366565, 60.334029796228037},
+ {-0.20463511500236109, 60.333954694375052},
+ };
+
+ auto const bestWay = osm::GetBestOsmWayOrRelation(osmResponse, geometry);
+ TEST_EQUAL(bestWay.attribute("id").value(), string("345630019"), ());
+}
diff --git a/editor/osm_feature_matcher.cpp b/editor/osm_feature_matcher.cpp
index fac7dc7305..fe421ba47e 100644
--- a/editor/osm_feature_matcher.cpp
+++ b/editor/osm_feature_matcher.cpp
@@ -11,7 +11,7 @@ namespace osm
{
using editor::XMLFeature;
-constexpr double kPointDiffEps = MercatorBounds::GetCellID2PointAbsEpsilon();
+constexpr double kPointDiffEps = 1e-5;
bool PointsEqual(m2::PointD const & a, m2::PointD const & b)
{