GitHub PullRequestReviewCommentEvent at 2014-07-23 10:36:34
Repository: navitia
Actor: antoine-de
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/15281058","id":15281058,"diff_hunk":"@@ -103,15 +103,47 @@ pbnavitia::Response make_pathes(const std::vector<navitia::routing::Path>& paths\n         pb_journey->set_nb_transfers(path.nb_changes);\n         pb_journey->set_requested_date_time(navitia::to_iso_string_no_fractional(path.request_time));\n \n-        // First streetnetwork item if it starts with coordinates\n-        if(!path.items.empty() && !path.items.front().stop_points.empty()) {\n-            const auto& departure_stop_point = path.items.front().stop_points.front();\n-            // for stop areas, we don't want to display the fallback section if start\n-            // from one of the stop area's stop point\n-            if (origin.uri != departure_stop_point->stop_area->uri) {\n+        if (path.items.empty()) {\n+            continue;\n+        }\n+        /*\n+         * For the first section, we can distinguish 2 cases\n+         * 1) We start from an area, we will add a crow fly section from the centroid of the area\n+         *    to the origin stop point of the first section\n+         * 2) We start from a ponctual place (everything but stop_area or admin)\n+         * We had a street network section from this place to the departure of the first pt_section\n+         * If the uri of the origin point and the uri of the departure of the first section are the\n+         * same we do nothing\n+         * */\n+\n+        if (origin.type == type::Type_e::Admin || origin.type == type::Type_e::StopArea) {\n+            if (path.items.front().stop_times.empty()) {\n+                continue;\n+            }\n+            const auto sp_dest = path.items.front().stop_times.front()->journey_pattern_point->stop_point;\n+            type::EntryPoint destination_tmp(type::Type_e::StopPoint, sp_dest->uri);\n+            bt::time_period action_period(path.items.front().departures.front(),\n+                                          path.items.front().departures.front()+bt::minutes(1));\n+            fill_crowfly_section(origin, destination_tmp, path.items.front().departures.front(),\n+                                 d, enhanced_response, pb_journey, now, action_period);\n+            // If we start from a stop_area, and the last stop point is not from that stop_area,","path":"source/routing/raptor_api.cpp","position":33,"original_position":33,"commit_id":"34e3ef3b99d7a134945723731c20bfd2634df0c4","original_commit_id":"34e3ef3b99d7a134945723731c20bfd2634df0c4","user":{"login":"antoine-de","id":3987698,"avatar_url":"https://avatars.githubusercontent.com/u/3987698?","gravatar_id":"8dd8d4a02558295ff9429c91d8423286","url":"https://api.github.com/users/antoine-de","html_url":"https://github.com/antoine-de","followers_url":"https://api.github.com/users/antoine-de/followers","following_url":"https://api.github.com/users/antoine-de/following{/other_user}","gists_url":"https://api.github.com/users/antoine-de/gists{/gist_id}","starred_url":"https://api.github.com/users/antoine-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoine-de/subscriptions","organizations_url":"https://api.github.com/users/antoine-de/orgs","repos_url":"https://api.github.com/users/antoine-de/repos","events_url":"https://api.github.com/users/antoine-de/events{/privacy}","received_events_url":"https://api.github.com/users/antoine-de/received_events","type":"User","site_admin":false},"body":"first stop point","created_at":"2014-07-23T10:36:34Z","updated_at":"2014-07-23T10:36:34Z","html_url":"https://github.com/CanalTP/navitia/pull/441#discussion_r15281058","pull_request_url":"https://api.github.com/repos/CanalTP/navitia/pulls/441","_links":{"self":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/15281058"},"html":{"href":"https://github.com/CanalTP/navitia/pull/441#discussion_r15281058"},"pull_request":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/441"}}},"pull_request":{"url":"https://api.github.com/repos/CanalTP/navitia/pulls/441","id":18578039,"html_url":"https://github.com/CanalTP/navitia/pull/441","diff_url":"https://github.com/CanalTP/navitia/pull/441.diff","patch_url":"https://github.com/CanalTP/navitia/pull/441.patch","issue_url":"https://api.github.com/repos/CanalTP/navitia/issues/441","number":441,"state":"open","title":"Add coherence to sections","user":{"login":"l-vincent-l","id":2757318,"avatar_url":"https://avatars.githubusercontent.com/u/2757318?","gravatar_id":"257c713557629d5e2948229fc146f387","url":"https://api.github.com/users/l-vincent-l","html_url":"https://github.com/l-vincent-l","followers_url":"https://api.github.com/users/l-vincent-l/followers","following_url":"https://api.github.com/users/l-vincent-l/following{/other_user}","gists_url":"https://api.github.com/users/l-vincent-l/gists{/gist_id}","starred_url":"https://api.github.com/users/l-vincent-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-vincent-l/subscriptions","organizations_url":"https://api.github.com/users/l-vincent-l/orgs","repos_url":"https://api.github.com/users/l-vincent-l/repos","events_url":"https://api.github.com/users/l-vincent-l/events{/privacy}","received_events_url":"https://api.github.com/users/l-vincent-l/received_events","type":"User","site_admin":false},"body":"__Add coherence in journey' sections__\r\n\r\nWe want to have coherence between the from (to) of a section and the from (to) of the request.\r\nIt also adds coherence between the to (from) of the streetnetwork section and the  from(to) of the first (last) public transport section. Therefore the to(from) of the streetnetwork section is now a stop_point, you still have the adress of the stop point in the place.\r\n\r\nWe also don't really know from where we start when we start from a area (a stop_area or an admin), thus we added a crow_fly section which starts from the centroid of this area and goes to the first stop_point of the first pt_section.","created_at":"2014-07-18T10:24:47Z","updated_at":"2014-07-23T10:36:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3595bd4963a968237223293d17349b6ed1c62563","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CanalTP/navitia/pulls/441/commits","review_comments_url":"https://api.github.com/repos/CanalTP/navitia/pulls/441/comments","review_comment_url":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/CanalTP/navitia/issues/441/comments","statuses_url":"https://api.github.com/repos/CanalTP/navitia/statuses/34e3ef3b99d7a134945723731c20bfd2634df0c4","head":{"label":"l-vincent-l:add_coherence_section","ref":"add_coherence_section","sha":"34e3ef3b99d7a134945723731c20bfd2634df0c4","user":{"login":"l-vincent-l","id":2757318,"avatar_url":"https://avatars.githubusercontent.com/u/2757318?","gravatar_id":"257c713557629d5e2948229fc146f387","url":"https://api.github.com/users/l-vincent-l","html_url":"https://github.com/l-vincent-l","followers_url":"https://api.github.com/users/l-vincent-l/followers","following_url":"https://api.github.com/users/l-vincent-l/following{/other_user}","gists_url":"https://api.github.com/users/l-vincent-l/gists{/gist_id}","starred_url":"https://api.github.com/users/l-vincent-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-vincent-l/subscriptions","organizations_url":"https://api.github.com/users/l-vincent-l/orgs","repos_url":"https://api.github.com/users/l-vincent-l/repos","events_url":"https://api.github.com/users/l-vincent-l/events{/privacy}","received_events_url":"https://api.github.com/users/l-vincent-l/received_events","type":"User","site_admin":false},"repo":{"id":19144735,"name":"navitia","full_name":"l-vincent-l/navitia","owner":{"login":"l-vincent-l","id":2757318,"avatar_url":"https://avatars.githubusercontent.com/u/2757318?","gravatar_id":"257c713557629d5e2948229fc146f387","url":"https://api.github.com/users/l-vincent-l","html_url":"https://github.com/l-vincent-l","followers_url":"https://api.github.com/users/l-vincent-l/followers","following_url":"https://api.github.com/users/l-vincent-l/following{/other_user}","gists_url":"https://api.github.com/users/l-vincent-l/gists{/gist_id}","starred_url":"https://api.github.com/users/l-vincent-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-vincent-l/subscriptions","organizations_url":"https://api.github.com/users/l-vincent-l/orgs","repos_url":"https://api.github.com/users/l-vincent-l/repos","events_url":"https://api.github.com/users/l-vincent-l/events{/privacy}","received_events_url":"https://api.github.com/users/l-vincent-l/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/l-vincent-l/navitia","description":"","fork":true,"url":"https://api.github.com/repos/l-vincent-l/navitia","forks_url":"https://api.github.com/repos/l-vincent-l/navitia/forks","keys_url":"https://api.github.com/repos/l-vincent-l/navitia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/l-vincent-l/navitia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/l-vincent-l/navitia/teams","hooks_url":"https://api.github.com/repos/l-vincent-l/navitia/hooks","issue_events_url":"https://api.github.com/repos/l-vincent-l/navitia/issues/events{/number}","events_url":"https://api.github.com/repos/l-vincent-l/navitia/events","assignees_url":"https://api.github.com/repos/l-vincent-l/navitia/assignees{/user}","branches_url":"https://api.github.com/repos/l-vincent-l/navitia/branches{/branch}","tags_url":"https://api.github.com/repos/l-vincent-l/navitia/tags","blobs_url":"https://api.github.com/repos/l-vincent-l/navitia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/l-vincent-l/navitia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/l-vincent-l/navitia/git/refs{/sha}","trees_url":"https://api.github.com/repos/l-vincent-l/navitia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/l-vincent-l/navitia/statuses/{sha}","languages_url":"https://api.github.com/repos/l-vincent-l/navitia/languages","stargazers_url":"https://api.github.com/repos/l-vincent-l/navitia/stargazers","contributors_url":"https://api.github.com/repos/l-vincent-l/navitia/contributors","subscribers_url":"https://api.github.com/repos/l-vincent-l/navitia/subscribers","subscription_url":"https://api.github.com/repos/l-vincent-l/navitia/subscription","commits_url":"https://api.github.com/repos/l-vincent-l/navitia/commits{/sha}","git_commits_url":"https://api.github.com/repos/l-vincent-l/navitia/git/commits{/sha}","comments_url":"https://api.github.com/repos/l-vincent-l/navitia/comments{/number}","issue_comment_url":"https://api.github.com/repos/l-vincent-l/navitia/issues/comments/{number}","contents_url":"https://api.github.com/repos/l-vincent-l/navitia/contents/{+path}","compare_url":"https://api.github.com/repos/l-vincent-l/navitia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/l-vincent-l/navitia/merges","archive_url":"https://api.github.com/repos/l-vincent-l/navitia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/l-vincent-l/navitia/downloads","issues_url":"https://api.github.com/repos/l-vincent-l/navitia/issues{/number}","pulls_url":"https://api.github.com/repos/l-vincent-l/navitia/pulls{/number}","milestones_url":"https://api.github.com/repos/l-vincent-l/navitia/milestones{/number}","notifications_url":"https://api.github.com/repos/l-vincent-l/navitia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/l-vincent-l/navitia/labels{/name}","releases_url":"https://api.github.com/repos/l-vincent-l/navitia/releases{/id}","created_at":"2014-04-25T12:07:12Z","updated_at":"2014-06-25T15:10:54Z","pushed_at":"2014-07-23T10:18:34Z","git_url":"git://github.com/l-vincent-l/navitia.git","ssh_url":"git@github.com:l-vincent-l/navitia.git","clone_url":"https://github.com/l-vincent-l/navitia.git","svn_url":"https://github.com/l-vincent-l/navitia","homepage":"http://www.navitia.io/","size":19916,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"CanalTP:dev","ref":"dev","sha":"865a8714ef3c79597f57f6473ba466e7e63486e6","user":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?","gravatar_id":null,"url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"repo":{"id":10797333,"name":"navitia","full_name":"CanalTP/navitia","owner":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?","gravatar_id":null,"url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CanalTP/navitia","description":"The REST API to build cool stuff with public transport","fork":false,"url":"https://api.github.com/repos/CanalTP/navitia","forks_url":"https://api.github.com/repos/CanalTP/navitia/forks","keys_url":"https://api.github.com/repos/CanalTP/navitia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CanalTP/navitia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CanalTP/navitia/teams","hooks_url":"https://api.github.com/repos/CanalTP/navitia/hooks","issue_events_url":"https://api.github.com/repos/CanalTP/navitia/issues/events{/number}","events_url":"https://api.github.com/repos/CanalTP/navitia/events","assignees_url":"https://api.github.com/repos/CanalTP/navitia/assignees{/user}","branches_url":"https://api.github.com/repos/CanalTP/navitia/branches{/branch}","tags_url":"https://api.github.com/repos/CanalTP/navitia/tags","blobs_url":"https://api.github.com/repos/CanalTP/navitia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CanalTP/navitia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CanalTP/navitia/git/refs{/sha}","trees_url":"https://api.github.com/repos/CanalTP/navitia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CanalTP/navitia/statuses/{sha}","languages_url":"https://api.github.com/repos/CanalTP/navitia/languages","stargazers_url":"https://api.github.com/repos/CanalTP/navitia/stargazers","contributors_url":"https://api.github.com/repos/CanalTP/navitia/contributors","subscribers_url":"https://api.github.com/repos/CanalTP/navitia/subscribers","subscription_url":"https://api.github.com/repos/CanalTP/navitia/subscription","commits_url":"https://api.github.com/repos/CanalTP/navitia/commits{/sha}","git_commits_url":"https://api.github.com/repos/CanalTP/navitia/git/commits{/sha}","comments_url":"https://api.github.com/repos/CanalTP/navitia/comments{/number}","issue_comment_url":"https://api.github.com/repos/CanalTP/navitia/issues/comments/{number}","contents_url":"https://api.github.com/repos/CanalTP/navitia/contents/{+path}","compare_url":"https://api.github.com/repos/CanalTP/navitia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CanalTP/navitia/merges","archive_url":"https://api.github.com/repos/CanalTP/navitia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CanalTP/navitia/downloads","issues_url":"https://api.github.com/repos/CanalTP/navitia/issues{/number}","pulls_url":"https://api.github.com/repos/CanalTP/navitia/pulls{/number}","milestones_url":"https://api.github.com/repos/CanalTP/navitia/milestones{/number}","notifications_url":"https://api.github.com/repos/CanalTP/navitia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CanalTP/navitia/labels{/name}","releases_url":"https://api.github.com/repos/CanalTP/navitia/releases{/id}","created_at":"2013-06-19T15:34:30Z","updated_at":"2014-07-22T16:25:31Z","pushed_at":"2014-07-23T10:32:48Z","git_url":"git://github.com/CanalTP/navitia.git","ssh_url":"git@github.com:CanalTP/navitia.git","clone_url":"https://github.com/CanalTP/navitia.git","svn_url":"https://github.com/CanalTP/navitia","homepage":"http://www.navitia.io","size":31065,"stargazers_count":51,"watchers_count":51,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":14,"mirror_url":null,"open_issues_count":14,"forks":14,"open_issues":14,"watchers":51,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/441"},"html":{"href":"https://github.com/CanalTP/navitia/pull/441"},"issue":{"href":"https://api.github.com/repos/CanalTP/navitia/issues/441"},"comments":{"href":"https://api.github.com/repos/CanalTP/navitia/issues/441/comments"},"review_comments":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/441/comments"},"review_comment":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/441/commits"},"statuses":{"href":"https://api.github.com/repos/CanalTP/navitia/statuses/34e3ef3b99d7a134945723731c20bfd2634df0c4"}}}}