Question

I am using WMATA API to create an application in Sencha touch, while using Method 4: Rail Paths which returns a list of stations between two given stations I realized that it works only if the stations are in the same line but it returns a "null" value if the source and destination are in different lines. Is it possible to get rail paths from 2 different rail lines. Let's say get the rail path form Vienna (orange line) to Greenbelt (green line)?? Please guide me.

Was it helpful?

Solution

It's not possible with the API alone. You'll have to find the route between the two stations and get the path for each segment (which would be constrained to a single line) individually. There's also no API for the Trip Planner (nor Google Transit), so you'll have to maintain your own database of stations to do the routing. That's fairly straightforward except in cases where there's more than one logical transfer point (such as going downtown on the Red Line from the Glenmont end, where you can transfer to the Green/Yellow Lines at Fort Totten and at Gallery Place; you'll either have to ask the user which route they want, or pick one arbitrarily). There are also some edge cases for routing, like when the Yellow Line doesn't go to Fort Totten. If you wanted to avoid the work of building the routing engine yourself, you might find OpenTripPlanner to be helpful, since you can just load the WMATA GTFS into OTP, but it might also be overkill for your needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top