J.P. Larocque (jp_larocque) wrote,

plug.self.gratuitous: Trip Planner ready for public consumption

Trip Planner is a simple web application to help you figure out how to take the bus between one location (where you're at now) and another (where you'd like to be). It serves Spokane County and the Spokane Transit Authority service area.

  • Quickly and easily tells you how to get there. No searching through schedules or deciding between one route and another.
  • Finds the nearest stop to your destination and points* it out on the map.
  • Tells you when it's faster to walk than to wait for the next bus.
  • Maps out your walking path and factors in the time it takes to walk, to make sure you're there on time.
  • Finds shortcuts. If you can get there faster by transferring to a different route—even if it's a few blocks away—Trip Planner hones in.

Trip Planner is nominally ready. (Nobody told me 75% of the time would be spent in data import and massage.) Most of the glaring flaws have been polished off, it's moderately quick, and now shows you a nice non-polling Web 2.0 Loading page while it computes trips.

At this point, I'm committing to not doing development/data-import changes on the live site (my workstation); this means it's safe to use! If you tried it before and it was flaking out on you, I should have known better. It works now.

If you're in Spokane, WA, you're encouraged to try it out; even if you think you know how to get somewhere by bus, Trip Planner might find a shortcut for all but the simplest trips. Also, for you drivers, reducing your oil consumption has never been more fashionable.

If you've taken a look at Trip Planner and don't think it would do what you want from it, or if it starts giving you flak, please send me feedback.


Trip Planner is written in Common Lisp. Major software it uses to get stuff done are Postmodern (PostgreSQL interface, used here for PostGIS), Hunchentoot (web server), and CXML (XML library, for XHTML document generation).

Trip Planner performs searches on a graph modeling Spokane County streets and bus routes.

Edges have both a generalized weight/cost function and a time-to-traverse function; usually, the former is equal to the latter, but the cost of walking is 1.5 times the time it takes to walk, by default. Bus stops are vertices, as are the route-vertices that define the path a bus takes. Edges from bus stops to route-vertices are dynamic: their traversal time depends on what time the search visits that stop.

Dijkstra's algorithm is trivially modified to take the "leaving-at" time as a search parameter, and to take traversal time into account during the search. (This is actually not a correct algorithm for finding the minimum-cost path in a time-dependent network, but does the right thing about 95% of the time; more on that later.)

* Lie Now implemented.

Tags: lisp, tp
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 7 comments