{"action":"created","issue":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/2836","repository_url":"https://api.github.com/repos/Project-OSRM/osrm-backend","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/2836/labels{/name}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/2836/comments","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/2836/events","html_url":"https://github.com/Project-OSRM/osrm-backend/issues/2836","id":174653683,"number":2836,"title":"How to calculate state miles.","user":{"login":"mdhanju","id":7625083,"avatar_url":"https://avatars.githubusercontent.com/u/7625083?v=3","gravatar_id":"","url":"https://api.github.com/users/mdhanju","html_url":"https://github.com/mdhanju","followers_url":"https://api.github.com/users/mdhanju/followers","following_url":"https://api.github.com/users/mdhanju/following{/other_user}","gists_url":"https://api.github.com/users/mdhanju/gists{/gist_id}","starred_url":"https://api.github.com/users/mdhanju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdhanju/subscriptions","organizations_url":"https://api.github.com/users/mdhanju/orgs","repos_url":"https://api.github.com/users/mdhanju/repos","events_url":"https://api.github.com/users/mdhanju/events{/privacy}","received_events_url":"https://api.github.com/users/mdhanju/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-02T00:08:11Z","updated_at":"2016-09-02T06:17:00Z","closed_at":"2016-09-02T06:17:00Z","body":"Any idea how to calculate state miles.\r\nFor example i travel from Los Angles to Dellas TX, need miles travelled in each state, CA, AZ, NM, and TX."},"comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments/244292370","html_url":"https://github.com/Project-OSRM/osrm-backend/issues/2836#issuecomment-244292370","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/2836","id":244292370,"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},"created_at":"2016-09-02T06:17:00Z","updated_at":"2016-09-02T06:17:00Z","body":"I would do the following:\r\n\r\n  1.  Get a copy of some state outlines, e.g. http://eric.clst.org/Stuff/USGeoJSON\r\n  2. Get the route line from OSRM\r\n  3. Load these shapes into PostGIS or QGIS\r\n  4. \"clip\" the route line using the state polygon using an intersect operation\r\n  5. measure the length of the clipped line\r\n  6. repeat for each state\r\n\r\nSome useful links:\r\n\r\nhttp://gis.stackexchange.com/questions/56874/how-to-split-line-layer-at-polygons-boundary-of-a-polygon-layer\r\n\r\nhttp://postgis.net/docs/ST_Intersection.html\r\n\r\nhttp://gis.stackexchange.com/questions/78835/how-to-clip-a-line-layer-based-on-polygons-with-qgis\r\n\r\nThis is not a feature OSRM would include, this is post-processing you would need to do on the route geometry."}}
{"actor":{"display_login":"danpat"}}