{"action":"created","issue":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3576","repository_url":"https://api.github.com/repos/Project-OSRM/osrm-backend","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3576/labels{/name}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3576/comments","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3576/events","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/3576","id":201262036,"number":3576,"title":"Fix for #3516","user":{"login":"oxidase","id":4421046,"avatar_url":"https://avatars.githubusercontent.com/u/4421046?v=3","gravatar_id":"","url":"https://api.github.com/users/oxidase","html_url":"https://github.com/oxidase","followers_url":"https://api.github.com/users/oxidase/followers","following_url":"https://api.github.com/users/oxidase/following{/other_user}","gists_url":"https://api.github.com/users/oxidase/gists{/gist_id}","starred_url":"https://api.github.com/users/oxidase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxidase/subscriptions","organizations_url":"https://api.github.com/users/oxidase/orgs","repos_url":"https://api.github.com/users/oxidase/repos","events_url":"https://api.github.com/users/oxidase/events{/privacy}","received_events_url":"https://api.github.com/users/oxidase/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-17T12:12:36Z","updated_at":"2017-01-17T13:55:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/3576","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/3576","diff_url":"https://github.com/Project-OSRM/osrm-backend/pull/3576.diff","patch_url":"https://github.com/Project-OSRM/osrm-backend/pull/3576.patch"},"body":"# Issue\r\n\r\nAnalysis for #3516:\r\nCoordinates in the response are different because they come from different sources at https://github.com/Project-OSRM/osrm-backend/blob/master/src/engine/plugins/match.cpp#L219 and there is no guarantee that they can be equal.\r\n\r\n* `geometry.coordinates[0]` -> [-73.990134, 40.751658] is a location of https://www.openstreetmap.org/node/42439952 and comes from https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/guidance/assemble_geometry.hpp#L64 even if `source_node` is {... location = {-73.990134, 40.751657}, input_location = {-73.99039, 40.75171}, ...}.\r\n\r\n* `tracepoints[0].location` -> [-73.990134, 40.751657] is a point in `candidates_lists = GetPhantomNodesInRange...` that is a projection of `query_location = {-73.99039, 40.75171}` onto `segment_source = {-73.989687, 40.752288}`, `segment_target = {-73.990134, 40.751658}` at https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/geospatial_query.hpp#L363-L367\r\n\r\nItself it is a rounding problem in `perpendicularDistance`, but would it make sense to use `source_node.location` as the first geometry point?\r\n\r\n\r\n## Tasklist\r\n - [x] add regression / cucumber cases (see docs/testing.md)\r\n - [ ] fix a problem\r\n - [ ] review\r\n - [ ] adjust for comments\r\n\r\n## Requirements / Relations\r\n Link any requirements here. Other pull requests this PR is based on?\r\n"},"comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments/273165853","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/3576#issuecomment-273165853","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/3576","id":273165853,"user":{"login":"oxidase","id":4421046,"avatar_url":"https://avatars.githubusercontent.com/u/4421046?v=3","gravatar_id":"","url":"https://api.github.com/users/oxidase","html_url":"https://github.com/oxidase","followers_url":"https://api.github.com/users/oxidase/followers","following_url":"https://api.github.com/users/oxidase/following{/other_user}","gists_url":"https://api.github.com/users/oxidase/gists{/gist_id}","starred_url":"https://api.github.com/users/oxidase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxidase/subscriptions","organizations_url":"https://api.github.com/users/oxidase/orgs","repos_url":"https://api.github.com/users/oxidase/repos","events_url":"https://api.github.com/users/oxidase/events{/privacy}","received_events_url":"https://api.github.com/users/oxidase/received_events","type":"User","site_admin":false},"created_at":"2017-01-17T13:55:39Z","updated_at":"2017-01-17T13:55:39Z","body":"yes, `geometry = {locations = {{-73.990134, 40.751657}, {-73.990134, 40.751658}, {-73.990263, 40.751481}}, segment_offsets = {0, 1, 2}, segment_distances = {0.1112262997322674, 22.488323336387797}, osm_node_ids = {1329098617, 42439952, 42437654}, annotations = ...}` is returned and at https://github.com/Project-OSRM/osrm-backend/blob/master/src/engine/guidance/post_processing.cpp#L1229 the first point is removed because both `zero_length_step` and `duplicated_coordinate` are true.\r\n\r\nIf the first point must be a projection of the input location then `trimShortSegments` must be adjusted.\r\n"}}
{"actor":{"display_login":"oxidase"}}