Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2016-01-28 18:38:13 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:16:56 +0300
commitc887f88f536ff75b99e1509f570ea2289fce09a4 (patch)
tree55b142c1d8ce196496cefef2e605f04250eebce0
parent516f4e4652db929831028398e55a624861a851a9 (diff)
[search] Limit building iterations count when getting address for point.
-rw-r--r--search/reverse_geocoder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/search/reverse_geocoder.cpp b/search/reverse_geocoder.cpp
index 1076667e6a..cd31ef4dbf 100644
--- a/search/reverse_geocoder.cpp
+++ b/search/reverse_geocoder.cpp
@@ -110,6 +110,7 @@ void ReverseGeocoder::GetNearbyAddress(m2::PointD const & center, Address & addr
unique_ptr<search::v2::HouseToStreetTable> table;
MwmSet::MwmHandle mwmHandle;
+ int triesCount = 0;
for (auto const & b : buildings)
{
if (!table || mwmHandle.GetId() != b.m_id.m_mwmId)
@@ -129,6 +130,10 @@ void ReverseGeocoder::GetNearbyAddress(m2::PointD const & center, Address & addr
addr.m_street = streets[ind];
return;
}
+
+ // Do not analyze more than 5 houses to get exact address.
+ if (++triesCount == 5)
+ return;
}
}