{"action":"created","issue":{"url":"https://api.github.com/repos/Transitime/core/issues/14","labels_url":"https://api.github.com/repos/Transitime/core/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/Transitime/core/issues/14/comments","events_url":"https://api.github.com/repos/Transitime/core/issues/14/events","html_url":"https://github.com/Transitime/core/issues/14","id":102208176,"number":14,"title":"PredAccuracyPrediction says in comment directionId can be null as not always provided.","user":{"login":"scrudden","id":6191822,"avatar_url":"https://avatars.githubusercontent.com/u/6191822?v=3","gravatar_id":"","url":"https://api.github.com/users/scrudden","html_url":"https://github.com/scrudden","followers_url":"https://api.github.com/users/scrudden/followers","following_url":"https://api.github.com/users/scrudden/following{/other_user}","gists_url":"https://api.github.com/users/scrudden/gists{/gist_id}","starred_url":"https://api.github.com/users/scrudden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrudden/subscriptions","organizations_url":"https://api.github.com/users/scrudden/orgs","repos_url":"https://api.github.com/users/scrudden/repos","events_url":"https://api.github.com/users/scrudden/events{/privacy}","received_events_url":"https://api.github.com/users/scrudden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-20T18:56:28Z","updated_at":"2015-08-21T17:45:20Z","closed_at":null,"body":"A null direction stops the handleArrivalDeparture method of PredictionAccuracyModule matching an arrivalDeparture event to a PredAccuracyPrediction in memory. The map key includes direction.\r\n\r\n````\r\nPredictionKey key = new PredictionKey(arrivalDeparture.getVehicleId(), \r\n\t\t\t\tarrivalDeparture.getDirectionId(), arrivalDeparture.getStopId());\r\n\t\tList<PredAccuracyPrediction> predsList = predictionMap.get(key);\r\n````\r\n\r\nNot sure on the solution but for me I did this in the new GTFSRealtimePredictionAccuracyModule I am working on. This is similar to what is done in NextBusPredictionAccuracyModule.\r\n````\r\nString direction=null;\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t if(update.getTrip().hasDirectionId())\r\n\t\t\t\t\t\t \t\tdirection=\"\"+update.getTrip().getDirectionId();\r\n\t\t\t\t\t\t \t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\tif (update.getTrip() != null) {\r\n\t\t\t\t\t\t\t\tTrip trip = dbConfig.getTrip(update.getTrip().getTripId());\r\n\t\t\t\t\t\t\t\tif (trip != null) {\r\n\t\t\t\t\t\t\t\t\tdirection = trip.getDirectionId();\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Got tripTag={} but no such trip in \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"the configuration.\", update.getTrip().getTripId());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n````"},"comment":{"url":"https://api.github.com/repos/Transitime/core/issues/comments/133508798","html_url":"https://github.com/Transitime/core/issues/14#issuecomment-133508798","issue_url":"https://api.github.com/repos/Transitime/core/issues/14","id":133508798,"user":{"login":"scrudden","id":6191822,"avatar_url":"https://avatars.githubusercontent.com/u/6191822?v=3","gravatar_id":"","url":"https://api.github.com/users/scrudden","html_url":"https://github.com/scrudden","followers_url":"https://api.github.com/users/scrudden/followers","following_url":"https://api.github.com/users/scrudden/following{/other_user}","gists_url":"https://api.github.com/users/scrudden/gists{/gist_id}","starred_url":"https://api.github.com/users/scrudden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrudden/subscriptions","organizations_url":"https://api.github.com/users/scrudden/orgs","repos_url":"https://api.github.com/users/scrudden/repos","events_url":"https://api.github.com/users/scrudden/events{/privacy}","received_events_url":"https://api.github.com/users/scrudden/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T17:45:20Z","updated_at":"2015-08-21T17:45:20Z","body":"Hi Mike,\r\nThe former (The system did not find a corresponding prediction). The GTFS feed I have has a direction in trip.txt but the GTFS-rt feed does not. So this meant I need to look up the database to find the direction of the trip. This is as was done in the NextBusPredictionAccuracyModule.\r\n\r\nThe GTFS-rt spec says about direction id\r\n\r\n\"Caution: this field is still experimental, and subject to change. It may be formally adopted in the future.\"\r\n\r\nI am looking into this further.\r\n\r\nCheers,\r\n\r\nSean.\r\n\r\n"}}