Am I supposed to call https://api.tfl.gov.uk/StopPoint/ for each and every intermediate stop point just to get the coordinates or is there a way to tell the journeys API to include coordinates of intermediate stopPoints in the journeys response?
I personally have a table that’s the cache of all the UK station locations. You can get most of them from “Stations.XML” and the rest you have to do using your 500 calls per minute you can do from TfL.
As a starter you’ve got the start and end lat/lng for each leg in the elevation section of the journey call, after that you could get all the intermediate stop locations from /line/route/sequence for the line and direction for each leg (fewer calls than for each stop point), as the stopPoint entries in there do have lat/lng
@nickp Yes, I have already implemented it that way in Trias that has the same problem (at least the Mentz implementation of Trias). Will do it again for TFL.
Thanks for the reminder.
If somebody from TFL is reading this: please fix this and insert intermediate stopPoint coordinates in the journey response.
At the moment, it is a waste of programmer time, waste of server calls, waste of bandwidth (money and time) on smartphones.
One look at the responses from the TfL API and their total unsuitability for mobile apps, I made a wrapper that I run on AWS Lambda. I have a couple of small lookup tables sitting in memory, one that converts from naptan codes to ics codes (they aren’t used consistently in the API) and another for looking up station details that aren’t included. When you consider the enormous amount of stuff that is included in a response that 95% of clients won’t want, skipping the stop point locations is odd.
I’m happy to share the JSON for the lookup tables I use (not covering all modes, but tube, dlr, overground & tflrail at least) with anyone that wants them.
Unrelated point, but I’ve noticed the fares have gone missing from the journey planner results lately too.