How to get public transport names?

I managed to get a working demo of the NYC public transportation system working. However, when trying to get a route between A and B, the directions don’t include the name of the subway line.

for example, I might get directions to get on the train at Church Av, go 5 stops to DeKalb Av, and then go 2 stops to Broadway-Lafayette St. However, Church Av has 2 different trains (F and G), DeKalb has 3 (B, Q, and R, and might be have transfers to other lines?), and Broadway-Lafayette has 5 trains.

without knowing which train to get on at any stop makes this fairly useless. is there any way to resolve this?

Did you try a different data set? Maybe there is a problem in the GTFS data.

originally, I tried it with data saved by a 3rd party. but I just tried it now with data straight from the NYC MTA and got the same thing.

I’m using the demo map at http://localhost:8989/maps/pt/
maybe that’s coded to not show the train names? my ultimate use case is to call it from an API, so if I can get it from there, I’ll be happy.

any ideas?

I think I figured it out. while the demo UI doesn’t show the subway names, the API calls have a route_id that seems to match up with the train name.

1 Like