diff options
author | vng <viktor.govako@gmail.com> | 2012-01-31 14:01:06 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:32:42 +0300 |
commit | 80bee1ab70f44911bfb36f0f2e44022e3849aed8 (patch) | |
tree | edfce863dbaaa89d48e5ad327632ecdd2dbb1a97 /indexer/feature_utils.cpp | |
parent | 734df51bc1334176745a2a9e0099029505280c4d (diff) |
[search] Take into account Alaska and Hawaii for search rank.
Diffstat (limited to 'indexer/feature_utils.cpp')
-rw-r--r-- | indexer/feature_utils.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index 9cbfc28550..9440a41989 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -95,9 +95,26 @@ public: population = max(population, static_cast<uint32_t>(10000)); else if (types[i] == m_TypeState) { - m2::RectD const usaRect(-125.73195962769162293, 25.168771674082393019, - -66.925073086214325713, 56.956377399113392812); - if (usaRect.IsPointInside(pt)) + m2::RectD usaRects[] = { + // Continental part of USA + m2::RectD(-125.73195962769162293, 25.168771674082393019, + -66.925073086214325713, 56.956377399113392812), + // Alaska + m2::RectD(-151.0, 63.0, -148.0, 66.0), + // Hawaii + m2::RectD(-179.3665041396082529, 17.740790096801504205, + -153.92127500280855656, 31.043358939740215874) + }; + + bool isUSA = false; + for (size_t i = 0; i < ARRAY_SIZE(usaRects); ++i) + if (usaRects[i].IsPointInside(pt)) + { + isUSA = true; + break; + } + + if (isUSA) { //LOG(LINFO, ("USA state population = ", population)); // Get rank equal to city for USA's states. |