{"action":"created","comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments/86957095","pull_request_review_id":7587227,"id":86957095,"diff_hunk":"@@ -400,206 +379,197 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad\n         };\n \n         std::unordered_map<NodeID, std::vector<SegmentData>> directed_graph;\n+        // Reserve enough space for unique edge-based-nodes on every edge.\n+        // Only a tile with all unique edges will use this much, but\n+        // it saves us a bunch of re-allocations during iteration.\n+        directed_graph.reserve(edges.size() * 2);\n \n         // Build an adjacency list for all the road segments visible in\n         // the tile\n         for (const auto &edge : edges)\n         {\n             if (edge.forward_segment_id.enabled)\n             {\n-                if (directed_graph.count(edge.u) == 0)\n+                // operator[] will construct an empty vector at [edge.u] if there is no value.\n+                directed_graph[edge.u].push_back({edge.v, edge.forward_segment_id.id});\n+                if (edge_based_node_info.count(edge.forward_segment_id.id) == 0)\n                 {\n-                    directed_graph[edge.u] = {{edge.v, edge.forward_segment_id.id}};\n+                    edge_based_node_info[edge.forward_segment_id.id] = {true,\n+                                                                        edge.packed_geometry_id};\n                 }\n                 else\n                 {\n-                    directed_graph[edge.u].push_back({edge.v, edge.forward_segment_id.id});\n+                    BOOST_ASSERT(\n+                        edge_based_node_info[edge.forward_segment_id.id].is_geometry_forward ==\n+                        true);\n+                    BOOST_ASSERT(\n+                        edge_based_node_info[edge.forward_segment_id.id].packed_geometry_id ==\n+                        edge.packed_geometry_id);\n                 }\n-                edge_based_node_info[edge.forward_segment_id.id] = {true, edge.packed_geometry_id};\n             }\n             if (edge.reverse_segment_id.enabled)\n             {\n-                if (directed_graph.count(edge.v) == 0)\n+                directed_graph[edge.v].push_back({edge.u, edge.reverse_segment_id.id});\n+                if (edge_based_node_info.count(edge.reverse_segment_id.id) == 0)","path":"src/engine/plugins/tile.cpp","position":null,"original_position":68,"commit_id":"3aff1afd9a8188e4cd44fe749beb5526b7a32da9","original_commit_id":"3aff1afd9a8188e4cd44fe749beb5526b7a32da9","user":{"login":"MoKob","id":12932279,"avatar_url":"https://avatars.githubusercontent.com/u/12932279?v=3","gravatar_id":"","url":"https://api.github.com/users/MoKob","html_url":"https://github.com/MoKob","followers_url":"https://api.github.com/users/MoKob/followers","following_url":"https://api.github.com/users/MoKob/following{/other_user}","gists_url":"https://api.github.com/users/MoKob/gists{/gist_id}","starred_url":"https://api.github.com/users/MoKob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoKob/subscriptions","organizations_url":"https://api.github.com/users/MoKob/orgs","repos_url":"https://api.github.com/users/MoKob/repos","events_url":"https://api.github.com/users/MoKob/events{/privacy}","received_events_url":"https://api.github.com/users/MoKob/received_events","type":"User","site_admin":false},"body":"same here, check for count is unneccessary, if reverse/forward segments are unique. This repeats my question from the last review if these can ever interact?","created_at":"2016-11-08T10:02:08Z","updated_at":"2016-11-08T10:04:39Z","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/3249#discussion_r86957095","pull_request_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249","_links":{"self":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments/86957095"},"html":{"href":"https://github.com/Project-OSRM/osrm-backend/pull/3249#discussion_r86957095"},"pull_request":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249"}}},"pull_request":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249","id":92429680,"html_url":"https://github.com/Project-OSRM/osrm-backend/pull/3249","diff_url":"https://github.com/Project-OSRM/osrm-backend/pull/3249.diff","patch_url":"https://github.com/Project-OSRM/osrm-backend/pull/3249.patch","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3249","number":3249,"state":"open","locked":false,"title":"Fix debug tile turn data","user":{"login":"danpat","id":1892250,"avatar_url":"https://avatars.githubusercontent.com/u/1892250?v=3","gravatar_id":"","url":"https://api.github.com/users/danpat","html_url":"https://github.com/danpat","followers_url":"https://api.github.com/users/danpat/followers","following_url":"https://api.github.com/users/danpat/following{/other_user}","gists_url":"https://api.github.com/users/danpat/gists{/gist_id}","starred_url":"https://api.github.com/users/danpat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpat/subscriptions","organizations_url":"https://api.github.com/users/danpat/orgs","repos_url":"https://api.github.com/users/danpat/repos","events_url":"https://api.github.com/users/danpat/events{/privacy}","received_events_url":"https://api.github.com/users/danpat/received_events","type":"User","site_admin":false},"body":"This PR addresses two tickets:\r\n\r\nhttps://github.com/Project-OSRM/osrm-backend/issues/3248 - turn angles are wrong, and some turns aren't showing up.\r\n\r\nThis was caused by changes to the geometry encoding - the plugin to be updated to find the reverse geometry properly in the new GetForward/GetReverse world.\r\n\r\nhttps://github.com/Project-OSRM/osrm-backend/issues/3064 - losing geometry near tile edges.  This was caused by a basic math error when adding a buffer to the bounding box - I was effectively shrinking the bounding box vertically, rather than growing it.\r\n\r\nWith this PR, we now get:\r\n<img width=\"798\" alt=\"screen shot 2016-11-04 at 2 54 46 pm\" src=\"https://cloud.githubusercontent.com/assets/1892250/20022523/961c22d2-a2a0-11e6-95bb-b3bb839edb54.png\">\r\n\r\n## Tasklist\r\n - [x] add regression / cucumber cases (see docs/testing.md)\r\n - [x] review\r\n - [ ] adjust for comments","created_at":"2016-11-04T23:10:40Z","updated_at":"2016-11-08T10:04:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8577e3064d3ae8b452cb7fdfce0752665f679711","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249/commits","review_comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249/comments","review_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3249/comments","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/3aff1afd9a8188e4cd44fe749beb5526b7a32da9","head":{"label":"Project-OSRM:fix_debug_tiles","ref":"fix_debug_tiles","sha":"3aff1afd9a8188e4cd44fe749beb5526b7a32da9","user":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"repo":{"id":2436255,"name":"osrm-backend","full_name":"Project-OSRM/osrm-backend","owner":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Project-OSRM/osrm-backend","description":"Open Source Routing Machine - C++ backend","fork":false,"url":"https://api.github.com/repos/Project-OSRM/osrm-backend","forks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/forks","keys_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/teams","hooks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/hooks","issue_events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/events{/number}","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/events","assignees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/assignees{/user}","branches_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/branches{/branch}","tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/tags","blobs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/languages","stargazers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/stargazers","contributors_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contributors","subscribers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscribers","subscription_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscription","commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contents/{+path}","compare_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/merges","archive_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/downloads","issues_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues{/number}","pulls_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/labels{/name}","releases_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/releases{/id}","deployments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/deployments","created_at":"2011-09-22T10:05:08Z","updated_at":"2016-11-07T05:13:47Z","pushed_at":"2016-11-08T09:47:04Z","git_url":"git://github.com/Project-OSRM/osrm-backend.git","ssh_url":"git@github.com:Project-OSRM/osrm-backend.git","clone_url":"https://github.com/Project-OSRM/osrm-backend.git","svn_url":"https://github.com/Project-OSRM/osrm-backend","homepage":"http://map.project-osrm.org","size":29470,"stargazers_count":1420,"watchers_count":1420,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":849,"mirror_url":null,"open_issues_count":319,"forks":849,"open_issues":319,"watchers":1420,"default_branch":"master"}},"base":{"label":"Project-OSRM:master","ref":"master","sha":"2fb40944bf408e1b6e673e32827c6e251e501541","user":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"repo":{"id":2436255,"name":"osrm-backend","full_name":"Project-OSRM/osrm-backend","owner":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Project-OSRM/osrm-backend","description":"Open Source Routing Machine - C++ backend","fork":false,"url":"https://api.github.com/repos/Project-OSRM/osrm-backend","forks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/forks","keys_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/teams","hooks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/hooks","issue_events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/events{/number}","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/events","assignees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/assignees{/user}","branches_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/branches{/branch}","tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/tags","blobs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/languages","stargazers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/stargazers","contributors_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contributors","subscribers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscribers","subscription_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscription","commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contents/{+path}","compare_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/merges","archive_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/downloads","issues_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues{/number}","pulls_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/labels{/name}","releases_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/releases{/id}","deployments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/deployments","created_at":"2011-09-22T10:05:08Z","updated_at":"2016-11-07T05:13:47Z","pushed_at":"2016-11-08T09:47:04Z","git_url":"git://github.com/Project-OSRM/osrm-backend.git","ssh_url":"git@github.com:Project-OSRM/osrm-backend.git","clone_url":"https://github.com/Project-OSRM/osrm-backend.git","svn_url":"https://github.com/Project-OSRM/osrm-backend","homepage":"http://map.project-osrm.org","size":29470,"stargazers_count":1420,"watchers_count":1420,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":849,"mirror_url":null,"open_issues_count":319,"forks":849,"open_issues":319,"watchers":1420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249"},"html":{"href":"https://github.com/Project-OSRM/osrm-backend/pull/3249"},"issue":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3249"},"comments":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3249/comments"},"review_comments":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249/comments"},"review_comment":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3249/commits"},"statuses":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/3aff1afd9a8188e4cd44fe749beb5526b7a32da9"}}}}
{"actor":{"display_login":"MoKob"}}