Tripplanner V2: ID of stop to siteId
Dear SL team,
I am searching in the tripplanner for trips and in the result I get an ID for a station. (e.g. 400120014 for Ropsten).
How can I translate this ID to the siteID of Ropsten?
Thanks a lot!
Matthias
I am searching in the tripplanner for trips and in the result I get an ID for a station. (e.g. 400120014 for Ropsten).
How can I translate this ID to the siteID of Ropsten?
Thanks a lot!
Matthias
Följ inlägget
0
följare
You can get this information from the other SL APIs.
There is one API that allows you to retrieve a rather big dataset that contains the mapping from stations to sites. The API is here: http://trafiklab.se/api/sl-hallplatser-och-linjer-2
Another alternative could be to use the station-lookup API with the station name and get the site id from that response. That API is here: http://trafiklab.se/api/sl-platsuppslag
Regards,
Dick
Thanks for your answer. I'd like to use the big dataset (mostly so I don't need to bother the other API every time) but I can't find the IDs in there.
My example ID from above Ropsten 400102132 is not found in neither the Site nor the StopID dataset.
Where do you think I should look? Or did you mean that I have to match on the name of the station rather than on the ID?
It seems that I was maybe too quick to answer. The ID that you have from the tripplanner API cannot be matched to a station using the big dataset as I suggested. I will take your question further and see if there are other solutions.
You could still do a match on the name even though I understand that you would prefer a more stricter mapping.
Regards,
Dick
I could match only by name but there are some Stations which are ambiguous. like "Alby" which can be a busstop somewhere on Ingmarö (I think) or a T-Bana station.
I just saw that the Tripplanner API also returns geo coordinates. So if you don't come up with a better solution then I will probably create my own database from the large Stoppoint dataset and then try to match based on geo coordinates and then also name...