From dbe89bdae197f482239671861665af62b23e22e6 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Wed, 13 Jan 2016 14:38:20 +0300 Subject: [PATCH] Replaced ReverseGeocoder::GetNearbyStreets(FeatureType) calls to avoid collision with GetNearbyFeatureStreets(FeatureType). --- generator/search_index_builder.cpp | 2 +- search/reverse_geocoder.cpp | 5 ----- search/reverse_geocoder.hpp | 6 ++---- search/v2/features_layer_matcher.cpp | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/generator/search_index_builder.cpp b/generator/search_index_builder.cpp index eaf8f6cb38..3eb9ff0340 100644 --- a/generator/search_index_builder.cpp +++ b/generator/search_index_builder.cpp @@ -341,7 +341,7 @@ void BuildAddressTable(FilesContainerR & container, Writer & writer) using TStreet = search::ReverseGeocoder::Street; vector streets; - rgc.GetNearbyStreets(ft, streets); + rgc.GetNearbyStreets(feature::GetCenter(ft), streets); streetIndex = rgc.GetMatchedStreetIndex(street, streets); if (streetIndex < streets.size()) diff --git a/search/reverse_geocoder.cpp b/search/reverse_geocoder.cpp index f3547170fc..c15ebb11ff 100644 --- a/search/reverse_geocoder.cpp +++ b/search/reverse_geocoder.cpp @@ -26,11 +26,6 @@ double const ReverseGeocoder::kLookupRadiusM = 500.0; ReverseGeocoder::ReverseGeocoder(Index const & index) : m_index(index) {} -void ReverseGeocoder::GetNearbyStreets(FeatureType const & addrFt, vector & streets) const -{ - GetNearbyStreets(feature::GetCenter(addrFt), streets); -} - void ReverseGeocoder::GetNearbyStreets(m2::PointD const & center, vector & streets) const { m2::RectD const rect = GetLookupRect(center, kLookupRadiusM); diff --git a/search/reverse_geocoder.hpp b/search/reverse_geocoder.hpp index 8c7e509243..c54a0356fe 100644 --- a/search/reverse_geocoder.hpp +++ b/search/reverse_geocoder.hpp @@ -53,8 +53,6 @@ public: } }; - void GetNearbyStreets(FeatureType const & addrFt, vector & streets) const; - static size_t GetMatchedStreetIndex(string const & keyName, vector const & streets); struct Address @@ -66,6 +64,8 @@ public: string GetStreetName() const { return m_street.m_name; } }; + void GetNearbyStreets(m2::PointD const & center, vector & streets) const; + void GetNearbyAddress(m2::PointD const & center, Address & addr) const; /// @returns street segments (can be duplicate names) sorted by distance to feature's center. @@ -78,8 +78,6 @@ public: private: static m2::RectD GetLookupRect(m2::PointD const & center, double radiusM); - - void GetNearbyStreets(m2::PointD const & center, vector & streets) const; }; } // namespace search diff --git a/search/v2/features_layer_matcher.cpp b/search/v2/features_layer_matcher.cpp index accfa37091..d63cc8c1d3 100644 --- a/search/v2/features_layer_matcher.cpp +++ b/search/v2/features_layer_matcher.cpp @@ -87,7 +87,7 @@ vector const & FeaturesLayerMatcher::GetNearbyStreetsIm uint32_t featureId, FeatureType & feature) { auto & streets = m_nearbyStreetsCache[featureId]; - m_reverseGeocoder.GetNearbyStreets(feature, streets); + m_reverseGeocoder.GetNearbyStreets(feature::GetCenter(feature), streets); return streets; } } // namespace v2