forked from organicmaps/organicmaps-tmp
[search] Fixed unclassified/service/road streets rank.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
parent
8b018de74d
commit
51b20ea661
4 changed files with 23 additions and 4 deletions
|
@ -346,16 +346,16 @@ IsWayChecker::IsWayChecker()
|
|||
{"primary", Regular},
|
||||
{"primary_link", Regular},
|
||||
{"residential", Residential},
|
||||
{"road", Outdoor},
|
||||
{"road", Minors},
|
||||
{"secondary", Regular},
|
||||
{"secondary_link",Regular},
|
||||
{"service", Residential},
|
||||
{"service", Minors},
|
||||
{"tertiary", Regular},
|
||||
{"tertiary_link", Regular},
|
||||
{"track", Outdoor},
|
||||
{"trunk", Motorway},
|
||||
{"trunk_link", Motorway},
|
||||
{"unclassified", Outdoor},
|
||||
{"unclassified", Minors},
|
||||
};
|
||||
|
||||
m_ranks.Reserve(std::size(types));
|
||||
|
|
|
@ -222,6 +222,7 @@ public:
|
|||
Pedestrian,
|
||||
Cycleway,
|
||||
Outdoor,
|
||||
Minors,
|
||||
Residential,
|
||||
Regular,
|
||||
Motorway,
|
||||
|
|
|
@ -84,6 +84,7 @@ double constexpr kStreetType[] = {
|
|||
0, // Pedestrian
|
||||
0, // Cycleway
|
||||
0, // Outdoor
|
||||
0.004, // Minors
|
||||
0.004, // Residential
|
||||
0.005, // Regular
|
||||
0.006, // Motorway
|
||||
|
@ -404,6 +405,7 @@ std::string DebugPrint(StreetType type)
|
|||
case StreetType::Pedestrian: return "Pedestrian";
|
||||
case StreetType::Cycleway: return "Cycleway";
|
||||
case StreetType::Outdoor: return "Outdoor";
|
||||
case StreetType::Minors: return "Minors";
|
||||
case StreetType::Residential: return "Residential";
|
||||
case StreetType::Regular: return "Regular";
|
||||
case StreetType::Motorway: return "Motorway";
|
||||
|
|
|
@ -533,7 +533,6 @@ UNIT_CLASS_TEST(MwmTestsFixture, Generic_Buildings_Rank)
|
|||
{
|
||||
auto request = MakeRequest("dia ", "en");
|
||||
auto const & results = request->Results();
|
||||
LOG(LINFO, (results));
|
||||
TEST_GREATER(results.size(), kTopPoiResultsCount, ());
|
||||
|
||||
Range const range(results);
|
||||
|
@ -570,4 +569,21 @@ UNIT_CLASS_TEST(MwmTestsFixture, UTH_Airport)
|
|||
TEST(found, (results));
|
||||
}
|
||||
|
||||
// https://github.com/organicmaps/organicmaps/issues/5186
|
||||
UNIT_CLASS_TEST(MwmTestsFixture, Milan_Streets)
|
||||
{
|
||||
// Milan
|
||||
ms::LatLon const center(45.46411, 9.19045);
|
||||
SetViewportAndLoadMaps(center);
|
||||
|
||||
auto request = MakeRequest("Via Domenichino", "it");
|
||||
auto const & results = request->Results();
|
||||
|
||||
size_t constexpr kResultsCount = 2;
|
||||
TEST_GREATER(results.size(), kResultsCount, ());
|
||||
|
||||
Range const range(results, 0, kResultsCount);
|
||||
TEST_LESS(SortedByDistance(range, center), 20000.0, ());
|
||||
}
|
||||
|
||||
} // namespace real_mwm_tests
|
||||
|
|
Loading…
Add table
Reference in a new issue