nickcapurso / MetroPlanner

App which tells you what trains to take and where to transfer to reach a desired destination.
1 stars 0 forks source link

Fix (and Improve) Routing Algorithm #3

Closed nickcapurso closed 8 years ago

nickcapurso commented 9 years ago

Previously, the WMATA API returned stations on a given line in a logical order:

Now, the stations are returned in a order relative to their unique station code, which is not necessarily the logical order (for example, the first station for the red line is Metro Center). The line selection and starting/ending stations are still selected properly.

The code assumes the station list will be in logical order, so now will need to be adjusted to accommodate the changes either by:

  1. Sorting the returned list into a logical ordering (from one end of the line to the other)
  2. Using the Station-to-Station API

The algorithm also relies on the fact that, for the D.C. Metro, all lines intersect every other line at at least one point.

Likely when work begins on this issue, it will be split until multiple, smaller issues.

nickcapurso commented 8 years ago

Issue has been fixed and pushed. Using the WMATA API's Path Between Stations function to get the logical sequence of stations for every line.