{"action":"created","issue":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2597","repository_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner","labels_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2597/labels{/name}","comments_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2597/comments","events_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2597/events","html_url":"https://github.com/opentripplanner/OpenTripPlanner/issues/2597","id":338876145,"node_id":"MDU6SXNzdWUzMzg4NzYxNDU=","number":2597,"title":"Parameter bannedRoutes ignored in PlannerResource API","user":{"login":"patrickj0607","id":21377443,"node_id":"MDQ6VXNlcjIxMzc3NDQz","avatar_url":"https://avatars1.githubusercontent.com/u/21377443?v=4","gravatar_id":"","url":"https://api.github.com/users/patrickj0607","html_url":"https://github.com/patrickj0607","followers_url":"https://api.github.com/users/patrickj0607/followers","following_url":"https://api.github.com/users/patrickj0607/following{/other_user}","gists_url":"https://api.github.com/users/patrickj0607/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickj0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickj0607/subscriptions","organizations_url":"https://api.github.com/users/patrickj0607/orgs","repos_url":"https://api.github.com/users/patrickj0607/repos","events_url":"https://api.github.com/users/patrickj0607/events{/privacy}","received_events_url":"https://api.github.com/users/patrickj0607/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-06T09:48:54Z","updated_at":"2018-07-06T10:22:41Z","closed_at":null,"author_association":"NONE","body":"## Expected behavior\r\nReceived trip does not contain any segment using the banned route.\r\n\r\n## Observed behavior\r\nReceived trip still contains the banned route.\r\n\r\n## Version of OTP used (exact commit hash or JAR name)\r\nce56c0b949136a20425903b40e7b1e7183d8213b\r\n\r\n## Data sets in use (links to GTFS and OSM PBF files)\r\nhttp://www.vbb.de/de/datei/GTFS.zip\r\n\r\n## Command line used to start OTP\r\njava -Xmx12G -jar otp-1.2.0-shaded.jar --basePath /local/opentripplanner --server --router ber2\r\n\r\n## Router config and graph build config JSON\r\n\r\n\r\n## Steps to reproduce the problem\r\nSend a request without any bannedStops:\r\n```\r\ncurl -X GET \\\r\n  'http://localhost:8080/otp/routers/ber2/plan?fromPlace=52.548637,13.388372&toPlace=52.506921,13.332707&showIntermediateStops=True&numItineraries=1&time=07:12:00&date=2017-09-19' \\\r\n```\r\nThe suggested trips contains the itinerary:\r\n```\r\n  {\r\n                \"duration\": 1160,\r\n                \"startTime\": 1505797979000,\r\n                \"endTime\": 1505799139000,\r\n                \"walkTime\": 184,\r\n                \"transitTime\": 606,\r\n                \"waitingTime\": 370,\r\n                \"walkDistance\": 241.36299999999994,\r\n                \"walkLimitExceeded\": false,\r\n                \"elevationLost\": 0,\r\n                \"elevationGained\": 0,\r\n                \"transfers\": 1,\r\n                \"legs\": [\r\n                    {\r\n                        \"startTime\": 1505797980000,\r\n                        \"endTime\": 1505798220000,\r\n                        \"departureDelay\": 0,\r\n                        \"arrivalDelay\": 0,\r\n                        \"realTime\": false,\r\n                        \"distance\": 2921.038924984495,\r\n                        \"pathway\": false,\r\n                        \"mode\": \"RAIL\",\r\n                        \"route\": \"RE5\",\r\n                        \"agencyName\": \"DB Regio AG\",\r\n                        \"agencyUrl\": \"http://www.bahn.de/brandenburg\",\r\n                        \"agencyTimeZoneOffset\": 7200000,\r\n                        \"routeType\": 100,\r\n                        \"routeId\": \"2:10883_100\",\r\n                        \"interlineWithPreviousLeg\": false,\r\n                        \"headsign\": \"Wünsdorf-Waldstadt, Bahnhof\",\r\n                        \"agencyId\": \"108\",\r\n                        \"tripId\": \"2:74127452\",\r\n                        \"serviceDate\": \"20170919\",\r\n                        \"from\": {\r\n                            \"name\": \"S+U Gesundbrunnen Bhf (Berlin)\",\r\n                            \"stopId\": \"2:000008011102\",\r\n                            \"lon\": 13.388372,\r\n                            \"lat\": 52.548637,\r\n                            \"departure\": 1505797980000,\r\n                            \"orig\": \"\",\r\n                            \"stopIndex\": 10,\r\n                            \"stopSequence\": 10,\r\n                            \"vertexType\": \"TRANSIT\"\r\n                        },\r\n                        \"to\": {\r\n                            \"name\": \"S+U Berlin Hauptbahnhof (tief)\",\r\n                            \"stopId\": \"2:000008098160\",\r\n                            \"lon\": 13.369386,\r\n                            \"lat\": 52.525042,\r\n                            \"arrival\": 1505798220000,\r\n                            \"departure\": 1505798220000,\r\n                            \"stopIndex\": 11,\r\n                            \"stopSequence\": 11,\r\n                            \"vertexType\": \"TRANSIT\"\r\n                        },\r\n                        \"legGeometry\": {\r\n                            \"points\": \"}kv_Ii|upAWpAJ`BNzBPrD`@vJ@TBfAFdDJlBVdCF|@d@vDT|A`@lCj@zCb@lBp@hCnAvEb@vAhBvFbG`Rd@nAz@jCdAzCtFfP`AtCj@xAfCtGzA|DbAfCfAnC`AfCh@bA`@n@d@l@Z`@h@j@\\\\Zp@f@n@Zv@Z|@Td@Fh@Fx@?^Ab@Cv@Kr@Uf@Sp@_@n@c@x@o@dKaLtCkDfAkAvBmB^_@xB}BbHyHl@k@nBiBtBaBnAiAlAu@TQlJyF\",\r\n                            \"length\": 68\r\n                        },\r\n                        \"routeShortName\": \"RE5\",\r\n                        \"rentedBike\": false,\r\n                        \"transitLeg\": true,\r\n                        \"duration\": 240,\r\n                        \"intermediateStops\": [],\r\n                        \"steps\": []\r\n                    },\r\n                    {\r\n                        \"startTime\": 1505798220000,\r\n                        \"endTime\": 1505798404000,\r\n                        \"departureDelay\": 0,\r\n                        \"arrivalDelay\": 0,\r\n                        \"realTime\": false,\r\n                        \"distance\": 241.36299999999994,\r\n                        \"pathway\": false,\r\n                        \"mode\": \"WALK\",\r\n                        \"route\": \"\",\r\n                        \"agencyTimeZoneOffset\": 7200000,\r\n                        \"interlineWithPreviousLeg\": false,\r\n                        \"from\": {\r\n                            \"name\": \"S+U Berlin Hauptbahnhof (tief)\",\r\n                            \"stopId\": \"2:000008098160\",\r\n                            \"lon\": 13.369386,\r\n                            \"lat\": 52.525042,\r\n                            \"arrival\": 1505798220000,\r\n                            \"departure\": 1505798220000,\r\n                            \"stopIndex\": 11,\r\n                            \"stopSequence\": 11,\r\n                            \"vertexType\": \"TRANSIT\"\r\n                        },\r\n                        \"to\": {\r\n                            \"name\": \"S+U Berlin Hauptbahnhof\",\r\n                            \"stopId\": \"2:060003201214\",\r\n                            \"lon\": 13.368924,\r\n                            \"lat\": 52.525847,\r\n                            \"arrival\": 1505798404000,\r\n                            \"departure\": 1505798772000,\r\n                            \"stopIndex\": 16,\r\n                            \"stopSequence\": 16,\r\n                            \"vertexType\": \"TRANSIT\"\r\n                        },\r\n                        \"legGeometry\": {\r\n                            \"points\": \"mxq_IoerpAC@a@X_B`ABNVODE@AFC@ADCBADE@?@AHEAU?UCBC@a@VEBEJA@I?c@X\",\r\n                            \"length\": 26\r\n                        },\r\n                        \"rentedBike\": false,\r\n                        \"transitLeg\": false,\r\n                        \"duration\": 184,\r\n                        \"intermediateStops\": [],\r\n                        \"steps\": [\r\n                            {\r\n                                \"distance\": 80.838,\r\n                                \"relativeDirection\": \"DEPART\",\r\n                                \"streetName\": \"Berlin Hauptbahnhof (Tief)\",\r\n                                \"absoluteDirection\": \"NORTHWEST\",\r\n                                \"stayOn\": false,\r\n                                \"area\": false,\r\n                                \"bogusName\": false,\r\n                                \"lon\": 13.369361408787261,\r\n                                \"lat\": 52.525035741763986,\r\n                                \"elevation\": []\r\n                            },\r\n                            {\r\n                                \"distance\": 160.525,\r\n                                \"relativeDirection\": \"LEFT\",\r\n                                \"streetName\": \"Fußweg\",\r\n                                \"absoluteDirection\": \"SOUTHWEST\",\r\n                                \"stayOn\": false,\r\n                                \"area\": false,\r\n                                \"bogusName\": true,\r\n                                \"lon\": 13.368892,\r\n                                \"lat\": 52.5257043,\r\n                                \"elevation\": []\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"startTime\": 1505798772000,\r\n                        \"endTime\": 1505799138000,\r\n                        \"departureDelay\": 0,\r\n                        \"arrivalDelay\": 0,\r\n                        \"realTime\": false,\r\n                        \"distance\": 3426.0658339056386,\r\n                        \"pathway\": false,\r\n                        \"mode\": \"RAIL\",\r\n                        \"route\": \"S7\",\r\n                        \"agencyName\": \"S-Bahn Berlin GmbH\",\r\n                        \"agencyUrl\": \"http://www.s-bahn-berlin.de\",\r\n                        \"agencyTimeZoneOffset\": 7200000,\r\n                        \"routeType\": 109,\r\n                        \"routeId\": \"2:10162_109\",\r\n                        \"interlineWithPreviousLeg\": false,\r\n                        \"headsign\": \"S Potsdam Hauptbahnhof\",\r\n                        \"agencyId\": \"1\",\r\n                        \"tripId\": \"2:70015642\",\r\n                        \"serviceDate\": \"20170919\",\r\n                        \"from\": {\r\n                            \"name\": \"S+U Berlin Hauptbahnhof\",\r\n                            \"stopId\": \"2:060003201214\",\r\n                            \"lon\": 13.368924,\r\n                            \"lat\": 52.525847,\r\n                            \"arrival\": 1505798404000,\r\n                            \"departure\": 1505798772000,\r\n                            \"stopIndex\": 16,\r\n                            \"stopSequence\": 16,\r\n                            \"vertexType\": \"TRANSIT\"\r\n                        },\r\n                        \"to\": {\r\n                            \"name\": \"S+U Zoologischer Garten Bhf (Berlin)\",\r\n                            \"stopId\": \"2:060023201256\",\r\n                            \"lon\": 13.332707,\r\n                            \"lat\": 52.506921,\r\n                            \"arrival\": 1505799138000,\r\n                            \"orig\": \"\",\r\n                            \"stopIndex\": 19,\r\n                            \"stopSequence\": 19,\r\n                            \"vertexType\": \"TRANSIT\"\r\n                        },\r\n                        \"legGeometry\": {\r\n                            \"points\": \"qyq_IedrpA??BVFnADl@B`@@FDPBRBT@FDV?HBHRdAJl@ZrA`@xAfApCN`@Rb@j@fAl@fAj@fAT^P`@LXNZL\\\\LXVl@hH`Q|CtHXx@Nd@Rt@V`AJl@Lt@NbAL`ADp@H`ABXBt@DbA@~A?d@Ap@ChAYbJChAEl@O|EAd@AZ_@rGCbA?BC|@C~AAJAN?L?PE~BAlACdA?|A@nAF~@AJPlBXxBLx@Rz@Nn@Pj@Tn@HV`@`ARb@\\\\n@RZTXLNDFNNHJRVfKrLfApAhAnANL^\\\\\\\\Xd@Vn@Zl@TRHPJ^NTH?@f@NJDZHb@PNHNDb@R~Aj@TFDBl@VJFtBx@LDZNVH|B`A|@`@^P\\\\NVPj@^^V\\\\VDDhBzAFHLFPPpB~AvApA|@x@VVn@\\\\\",\r\n                            \"length\": 138\r\n                        },\r\n                        \"routeShortName\": \"S7\",\r\n                        \"rentedBike\": false,\r\n                        \"transitLeg\": true,\r\n                        \"duration\": 366,\r\n                        \"intermediateStops\": [\r\n                            {\r\n                                \"name\": \"S Bellevue (Berlin)\",\r\n                                \"stopId\": \"2:060003102224\",\r\n                                \"lon\": 13.347098,\r\n                                \"lat\": 52.519951,\r\n                                \"arrival\": 1505798898000,\r\n                                \"departure\": 1505798928000,\r\n                                \"stopIndex\": 17,\r\n                                \"stopSequence\": 17,\r\n                                \"vertexType\": \"TRANSIT\"\r\n                            },\r\n                            {\r\n                                \"name\": \"S Tiergarten (Berlin)\",\r\n                                \"stopId\": \"2:060003103234\",\r\n                                \"lon\": 13.336235,\r\n                                \"lat\": 52.513963,\r\n                                \"arrival\": 1505799024000,\r\n                                \"departure\": 1505799054000,\r\n                                \"stopIndex\": 18,\r\n                                \"stopSequence\": 18,\r\n                                \"vertexType\": \"TRANSIT\"\r\n                            }\r\n                        ],\r\n                        \"steps\": []\r\n                    }\r\n                ],\r\n                \"tooSloped\": false\r\n            }\r\n```\r\nGet agencyID (required for ``bannedRoutes`` parameter) by using the index API.\r\n```\r\n    {\r\n        \"id\": \"108\",\r\n        \"name\": \"DB Regio AG\",\r\n        \"url\": \"http://www.bahn.de/brandenburg\",\r\n        \"timezone\": \"Europe/Berlin\",\r\n        \"lang\": \"de\"\r\n    },\r\n```\r\nSend same request as before, now banning the line ``RE5`` using the parameter ``bannedRoutes=108_RE5`` whereas ``108`` is the agency ID and ``RE5`` the shortName for the route. \r\n```\r\ncurl -X GET \\\r\n  'http://localhost:8080/otp/routers/ber2/plan?fromPlace=52.548637,13.388372&toPlace=52.506921,13.332707&showIntermediateStops=True&numItineraries=1&bannedRoutes=108_RE5&time=07:12:00&date=2017-09-19'\r\n```\r\nAs result, the same itinerary as before is returned. Using instead the parameter ``bannedAgencies=108`` returns a new trip without the agency 108 (and train with routeShortName RE5). However, bannedAgencies completely removes any routes from the agency and does not reflect my desired behavior (I just want to exclude a single route)."},"comment":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/comments/402994212","html_url":"https://github.com/opentripplanner/OpenTripPlanner/issues/2597#issuecomment-402994212","issue_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2597","id":402994212,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjk5NDIxMg==","user":{"login":"abyrd","id":112871,"node_id":"MDQ6VXNlcjExMjg3MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/112871?v=4","gravatar_id":"","url":"https://api.github.com/users/abyrd","html_url":"https://github.com/abyrd","followers_url":"https://api.github.com/users/abyrd/followers","following_url":"https://api.github.com/users/abyrd/following{/other_user}","gists_url":"https://api.github.com/users/abyrd/gists{/gist_id}","starred_url":"https://api.github.com/users/abyrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abyrd/subscriptions","organizations_url":"https://api.github.com/users/abyrd/orgs","repos_url":"https://api.github.com/users/abyrd/repos","events_url":"https://api.github.com/users/abyrd/events{/privacy}","received_events_url":"https://api.github.com/users/abyrd/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T10:22:41Z","updated_at":"2018-07-06T10:22:41Z","author_association":"MEMBER","body":"Hello, OTP can load more than one GTFS feed. Objects (routes, stops, agencies) in two different GTFS feeds may have exactly the same ID. Therefore prefixing entity IDs with agency IDs does not make them unique, and we had to introduce the notion of feed IDs. We are using an external library that identifies entities as (agencyId, entityId), but actually throughout OTP we are using (feedId, entityId). Your feed may declare a feed ID in its feed_info.txt, otherwise OTP will make one up and will log that feed ID when it starts up (should be something like \"feed1\").\r\n\r\nPlease try feedId_routeId and let me know in a comment on this ticket whether it works, then we can update the documentation.\r\n\r\nUnfortunately when these \"banned X\" query parameters were added by various different people, conventions were not followed to make them all accept parameters in the same format. This banned routes parameter even accepts [agencyId]_[routeName]_[routeId] which is unlike any of the others. So all of this will likely be revised in a future version 2.0 of the OTP API. In the future the format should really be feedId:routeId. We'll make that change in the 2.0 branch of OTP once it exists.\r\n"}}
{"actor":{"display_login":"abyrd"}}