{"action":"created","issue":{"url":"https://api.github.com/repos/graphhopper/graphhopper/issues/890","repository_url":"https://api.github.com/repos/graphhopper/graphhopper","labels_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/890/labels{/name}","comments_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/890/comments","events_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/890/events","html_url":"https://github.com/graphhopper/graphhopper/pull/890","id":191910137,"number":890,"title":"Allow to block Edges per Request","user":{"login":"boldtrn","id":1553525,"avatar_url":"https://avatars.githubusercontent.com/u/1553525?v=3","gravatar_id":"","url":"https://api.github.com/users/boldtrn","html_url":"https://github.com/boldtrn","followers_url":"https://api.github.com/users/boldtrn/followers","following_url":"https://api.github.com/users/boldtrn/following{/other_user}","gists_url":"https://api.github.com/users/boldtrn/gists{/gist_id}","starred_url":"https://api.github.com/users/boldtrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boldtrn/subscriptions","organizations_url":"https://api.github.com/users/boldtrn/orgs","repos_url":"https://api.github.com/users/boldtrn/repos","events_url":"https://api.github.com/users/boldtrn/events{/privacy}","received_events_url":"https://api.github.com/users/boldtrn/received_events","type":"User","site_admin":false},"labels":[{"id":32202809,"url":"https://api.github.com/repos/graphhopper/graphhopper/labels/new%20feature","name":"new feature","color":"0b02e1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/graphhopper/graphhopper/milestones/10","html_url":"https://github.com/graphhopper/graphhopper/milestones/0.9","labels_url":"https://api.github.com/repos/graphhopper/graphhopper/milestones/10/labels","id":2067244,"number":10,"title":"0.9","description":"","creator":{"login":"karussell","id":129644,"avatar_url":"https://avatars.githubusercontent.com/u/129644?v=3","gravatar_id":"","url":"https://api.github.com/users/karussell","html_url":"https://github.com/karussell","followers_url":"https://api.github.com/users/karussell/followers","following_url":"https://api.github.com/users/karussell/following{/other_user}","gists_url":"https://api.github.com/users/karussell/gists{/gist_id}","starred_url":"https://api.github.com/users/karussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karussell/subscriptions","organizations_url":"https://api.github.com/users/karussell/orgs","repos_url":"https://api.github.com/users/karussell/repos","events_url":"https://api.github.com/users/karussell/events{/privacy}","received_events_url":"https://api.github.com/users/karussell/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":25,"state":"open","created_at":"2016-10-13T08:36:01Z","updated_at":"2016-11-28T12:07:56Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-11-28T03:07:04Z","updated_at":"2016-11-30T22:04:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/890","html_url":"https://github.com/graphhopper/graphhopper/pull/890","diff_url":"https://github.com/graphhopper/graphhopper/pull/890.diff","patch_url":"https://github.com/graphhopper/graphhopper/pull/890.patch"},"body":"This PR intents to improve #789. You can either block areas (given as BBox), points (closest edge from Lat,Lng), or by edge_id.\r\n\r\nThis is currently implemented only for the GenericWeighting, as my Approach is to inject the Weighting and change the weight of certain edges.\r\n\r\nHere is an example. This is the unblocked route:\r\n![block_nothing](https://cloud.githubusercontent.com/assets/1553525/20655025/aca2463c-b572-11e6-854b-af483048b919.png)\r\n\r\nThis is the route with the black area blocked:\r\n![blocked_area](https://cloud.githubusercontent.com/assets/1553525/20655035/c6f89c84-b572-11e6-8f43-62336d8f9435.png)\r\n\r\nThis is the route with the black area and black point blocked:\r\n![blocked_area_point](https://cloud.githubusercontent.com/assets/1553525/20655034/c36a75f6-b572-11e6-8394-70b48d0b3690.png)\r\n\r\nAll three cases can be seen in the new Integration test.\r\n\r\nThings we might want to add:\r\n\r\n- Returned the blocked edge ids, this would allow us to cache the blocked edges for further requests (not sure how much speed this would get us).\r\n- Add the possibility to manage arrays or lists in the HintsMap. Right now a limitation of the current approach is that the parameters are single strings, for example: `routing.non_ch.blocked_points=lat,lon,lat,lon`. This approach works for now, but it would be nice to be able to add every point seperated by &. On the other hand urls might get very long, as the naming is currently rather long.\r\n- Add a (helper)class that searches the Graph for edges that are in a BBox, or maybe circle, or ...\r\n\r\nBTW: I added calling super() in GHBitSetImpl(), I figured we might forgot to add it at this position, but I am not sure, so if that was wrong, I can remove it?\r\n\r\nBTW2: I did a rough speed comparison on my laptop. I planned a route accross Baden Württemberg, from Lindau to Karlsruhe, so approx. 260km. Without blocking anything the request took about 1s. With blocking a huge area (approx. half Baden Württemberg - BBox: `8.2645,48.1056,9.9124,48.8557` - the blocked edge set **contains 790876 edges**) the request took about 1.5s, which surprised myself, I thought the speed would be massively decreased. \r\n\r\nUnblocked:\r\n![unblocked_bw](https://cloud.githubusercontent.com/assets/1553525/20655449/abb607be-b576-11e6-80d7-a9ab16e94ca3.png)\r\n\r\nBlocked:\r\n![blocked_bw](https://cloud.githubusercontent.com/assets/1553525/20655453/b2552f8c-b576-11e6-983c-4c58893a9ba2.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/graphhopper/graphhopper/issues/comments/264010361","html_url":"https://github.com/graphhopper/graphhopper/pull/890#issuecomment-264010361","issue_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/890","id":264010361,"user":{"login":"boldtrn","id":1553525,"avatar_url":"https://avatars.githubusercontent.com/u/1553525?v=3","gravatar_id":"","url":"https://api.github.com/users/boldtrn","html_url":"https://github.com/boldtrn","followers_url":"https://api.github.com/users/boldtrn/followers","following_url":"https://api.github.com/users/boldtrn/following{/other_user}","gists_url":"https://api.github.com/users/boldtrn/gists{/gist_id}","starred_url":"https://api.github.com/users/boldtrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boldtrn/subscriptions","organizations_url":"https://api.github.com/users/boldtrn/orgs","repos_url":"https://api.github.com/users/boldtrn/repos","events_url":"https://api.github.com/users/boldtrn/events{/privacy}","received_events_url":"https://api.github.com/users/boldtrn/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T22:04:20Z","updated_at":"2016-11-30T22:04:20Z","body":"Injecting means we would need to add a new Weighting.setGraph method.\r\n\r\nYes, I would add a setNodeAccessMethod. Probably something like:\r\n\r\n```\r\nif(weighting instanceof GenericWeighting)\r\n   weighting.setNodeAccess(queryGraph.getNodeAccess);\r\n``` \r\n\r\n> But moving it before the weighting creation would not work for CH\r\n\r\nYes exactly. Therefore I would create a second RoutingGraph, which is also very ugly. I am not sure about the perfomance impact of creating a RoutingGraph?"}}
{"actor":{"display_login":"boldtrn"}}