Combining Route Sequence info

Trying to get all possible routes for a (tube) line I’m making the following call
Line/piccadilly/Route/Sequence/all
The RouteSequence response contains these 3 fields

  • lineStrings : 5 arrays of LatLongs
  • orderedLineRoutes : 5 arrays of naptanIds
  • stopPointSequences : 8 arrays of MatchedStops that can result into 5 joining the branches using prev/next branchId info

It seems that lineStrings[x] does not always correspond to orderedLineRoutes[x].
What is the proper way to extract those 5 triples taking one array from each field?

albert,

https://api.tfl.gov.uk/line/piccadilly/Route/Sequence/all

As you point out there is an early “linestrings”

This is just for drawing the line on a map, so it’s just drawing data.

However, if you look for the “lat” and “lon” in the data you will find the stations

image

Does this help?

So, does Google use “lineStrings” for the public transport data on the public maps?

Also, it is always good to cross-check the data from TfL with Detailled London transport map (track, depot, ...)

image

1 Like

Thanks for the quick response. Yes I thought relating linestrings with stopPointSequence using lat lon and relating orderedLineRoutes with stopPointSequence using naptanIds.
In tube it’s not so obvious because the same lat-lon can be in many linestrings and in many branches( inbound outbound). Same naptanId can be in more than one of the 5 arrays in orderedLineRoutes and in more than one array in stopPointSequence.

Edit
I need both the lineStrings and the stations. If you look at the buses route there are much more lat-lon data in lineStrings than in stations so we can see the exact bus journey.
Actually in buses many lat-lon station points don’t exist in lineStrings data

1 Like