{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/52177304","id":52177304,"diff_hunk":"@@ -62,21 +67,44 @@ class ReverseGeocoder\n \n     string GetHouseNumber() const { return m_building.m_name; }\n     string GetStreetName() const { return m_street.m_name; }\n+    double GetDistance() const { return m_building.m_distanceMeters; }\n   };\n \n-  void GetNearbyStreets(m2::PointD const & center, vector<Street> & streets) const;\n+  /// @return Sorted by distance streets vector for the specified MwmId.\n+  //@{\n+  void GetNearbyStreets(MwmSet::MwmId const & id, m2::PointD const & center,\n+                        vector<Street> & streets) const;\n+  void GetNearbyStreets(FeatureType & ft, vector<Street> & streets) const;\n+  //@}\n+\n+  /// @todo Leave const reference for now to support client's legacy code.\n+  /// It's better to use honest non-const reference when feature can be modified in any way.\n+  pair<vector<Street>, uint32_t> GetNearbyFeatureStreets(FeatureType const & ft) const;\n \n+  /// @return The nearest exact address where building has house number and valid street match.\n   void GetNearbyAddress(m2::PointD const & center, Address & addr) const;\n+  /// @return The exact address for feature.\n+  /// @precondition ft Should have house number.\n+  void GetNearbyAddress(FeatureType & ft, Address & addr) const;\n \n-  /// @returns street segments (can be duplicate names) sorted by distance to feature's center.\n-  /// uint32_t, if less than vector.size(), contains index of exact feature's street specified in OSM data.\n-  pair<vector<Street>, uint32_t> GetNearbyFeatureStreets(FeatureType const & feature) const;\n+private:\n \n-  void GetNearbyBuildings(m2::PointD const & center, vector<Building> & buildings) const;\n+  /// Helper class to incapsulate house 2 street table reloading.\n+  class HouseTable\n+  {\n+    unique_ptr<search::v2::HouseToStreetTable> m_table;\n+    MwmSet::MwmHandle m_mwmHandle;\n+  public:\n+    bool Get(Index const & index, FeatureID fId,\n+             vector<Street> const & streets, uint32_t & stIndex);\n+  };\n \n-  void GetNearbyBuildings(m2::PointD const & center, double radiusM, vector<Building> & buildings) const;\n+  bool GetNearbyAddress(HouseTable & table, Building const & bld, Address & addr) const;\n \n-private:\n+  /// @return Sorted by distance houses vector with valid house number.","path":"search/reverse_geocoder.hpp","position":73,"original_position":73,"commit_id":"585955109af184b98080845c01f6bf3cb23053f6","original_commit_id":"585955109af184b98080845c01f6bf3cb23053f6","user":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"body":"Эта функция используется в поиске, при пересечении слоя POI со слоем домов. Если отсекать первые n, где n фиксировано, то легко придумать контрпример где в районе именованной фичи n + 1 домов, n безымянные а n + 1 с именем. И такой запрос мы обрабатывать не будем. Если уж решили что при пересечении домов с поями используем такой-то радиус, то его нужно честно использовать.","created_at":"2016-02-08T14:51:04Z","updated_at":"2016-02-08T14:51:04Z","html_url":"https://github.com/mapsme/omim/pull/1666#discussion_r52177304","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/1666","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/52177304"},"html":{"href":"https://github.com/mapsme/omim/pull/1666#discussion_r52177304"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/1666"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/1666","id":57387612,"html_url":"https://github.com/mapsme/omim/pull/1666","diff_url":"https://github.com/mapsme/omim/pull/1666.diff","patch_url":"https://github.com/mapsme/omim/pull/1666.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/1666","number":1666,"state":"open","locked":false,"title":"[search] Show address in the search table UI.","user":{"login":"vng","id":175612,"avatar_url":"https://avatars.githubusercontent.com/u/175612?v=3","gravatar_id":"","url":"https://api.github.com/users/vng","html_url":"https://github.com/vng","followers_url":"https://api.github.com/users/vng/followers","following_url":"https://api.github.com/users/vng/following{/other_user}","gists_url":"https://api.github.com/users/vng/gists{/gist_id}","starred_url":"https://api.github.com/users/vng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vng/subscriptions","organizations_url":"https://api.github.com/users/vng/orgs","repos_url":"https://api.github.com/users/vng/repos","events_url":"https://api.github.com/users/vng/events{/privacy}","received_events_url":"https://api.github.com/users/vng/received_events","type":"User","site_admin":false},"body":"- Адрес в UI поиска\r\n- Подрефакторил интерфейсы ReverseGeocoder, чтобы он работал в контексте указанной MWM.\r\n- Если нет соответствия улицы, матчим при поиске номер дома на ближайшую (100 м).","created_at":"2016-01-27T16:48:05Z","updated_at":"2016-02-08T14:51:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e34973e2fd958489c5a6f1e85c10c4a0f08fd27","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/1666/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/1666/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/1666/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/585955109af184b98080845c01f6bf3cb23053f6","head":{"label":"vng:ns","ref":"ns","sha":"585955109af184b98080845c01f6bf3cb23053f6","user":{"login":"vng","id":175612,"avatar_url":"https://avatars.githubusercontent.com/u/175612?v=3","gravatar_id":"","url":"https://api.github.com/users/vng","html_url":"https://github.com/vng","followers_url":"https://api.github.com/users/vng/followers","following_url":"https://api.github.com/users/vng/following{/other_user}","gists_url":"https://api.github.com/users/vng/gists{/gist_id}","starred_url":"https://api.github.com/users/vng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vng/subscriptions","organizations_url":"https://api.github.com/users/vng/orgs","repos_url":"https://api.github.com/users/vng/repos","events_url":"https://api.github.com/users/vng/events{/privacy}","received_events_url":"https://api.github.com/users/vng/received_events","type":"User","site_admin":false},"repo":{"id":43431189,"name":"omim","full_name":"vng/omim","owner":{"login":"vng","id":175612,"avatar_url":"https://avatars.githubusercontent.com/u/175612?v=3","gravatar_id":"","url":"https://api.github.com/users/vng","html_url":"https://github.com/vng","followers_url":"https://api.github.com/users/vng/followers","following_url":"https://api.github.com/users/vng/following{/other_user}","gists_url":"https://api.github.com/users/vng/gists{/gist_id}","starred_url":"https://api.github.com/users/vng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vng/subscriptions","organizations_url":"https://api.github.com/users/vng/orgs","repos_url":"https://api.github.com/users/vng/repos","events_url":"https://api.github.com/users/vng/events{/privacy}","received_events_url":"https://api.github.com/users/vng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vng/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/vng/omim","forks_url":"https://api.github.com/repos/vng/omim/forks","keys_url":"https://api.github.com/repos/vng/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vng/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vng/omim/teams","hooks_url":"https://api.github.com/repos/vng/omim/hooks","issue_events_url":"https://api.github.com/repos/vng/omim/issues/events{/number}","events_url":"https://api.github.com/repos/vng/omim/events","assignees_url":"https://api.github.com/repos/vng/omim/assignees{/user}","branches_url":"https://api.github.com/repos/vng/omim/branches{/branch}","tags_url":"https://api.github.com/repos/vng/omim/tags","blobs_url":"https://api.github.com/repos/vng/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vng/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vng/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/vng/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vng/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/vng/omim/languages","stargazers_url":"https://api.github.com/repos/vng/omim/stargazers","contributors_url":"https://api.github.com/repos/vng/omim/contributors","subscribers_url":"https://api.github.com/repos/vng/omim/subscribers","subscription_url":"https://api.github.com/repos/vng/omim/subscription","commits_url":"https://api.github.com/repos/vng/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/vng/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/vng/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/vng/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/vng/omim/contents/{+path}","compare_url":"https://api.github.com/repos/vng/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vng/omim/merges","archive_url":"https://api.github.com/repos/vng/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vng/omim/downloads","issues_url":"https://api.github.com/repos/vng/omim/issues{/number}","pulls_url":"https://api.github.com/repos/vng/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/vng/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/vng/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vng/omim/labels{/name}","releases_url":"https://api.github.com/repos/vng/omim/releases{/id}","deployments_url":"https://api.github.com/repos/vng/omim/deployments","created_at":"2015-09-30T12:19:26Z","updated_at":"2015-09-30T12:21:35Z","pushed_at":"2016-02-08T12:51:31Z","git_url":"git://github.com/vng/omim.git","ssh_url":"git@github.com:vng/omim.git","clone_url":"https://github.com/vng/omim.git","svn_url":"https://github.com/vng/omim","homepage":null,"size":2070594,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:new-search","ref":"new-search","sha":"4cd5c19e73665271761a73d5baf844094fb1598b","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-02-06T16:07:55Z","pushed_at":"2016-02-08T14:42:45Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2120658,"stargazers_count":1609,"watchers_count":1609,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":221,"mirror_url":null,"open_issues_count":105,"forks":221,"open_issues":105,"watchers":1609,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/1666"},"html":{"href":"https://github.com/mapsme/omim/pull/1666"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/1666"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/1666/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/1666/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/1666/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/585955109af184b98080845c01f6bf3cb23053f6"}}}}