Trip Planner web service
Base URL: http://developer.trimet.org/ws/V1/trips/tripplanner
Request parameters:
| Name | Value | Description |
|---|---|---|
| fromPlace | string (optional) | fromPlace=pdx a successful request requires a fromPlace and/or fromCoord. if the request lacks a fromCoord, fromPlace will geocode as the origin of the trip |
| fromCoord | string (optional) | fromCoord=-122.72,45.51 if fromPlace exists along with fromCoord, then fromPlace will not engage the geocoder, thus making fromPlace simply a place label |
| toPlace | string (optional) | toPlace=zoo a successful request requires a toPlace and/or toCoord. if the request lacks a toCoord, toPlace will first be geocoded as the destination of the trip |
| toCoord | string (optional) | toCoord=-122.72,45.51 if toPlace exists along with toCoord, then toPlace will not engage the geocoder, thus making toPlace simply a place label |
| Date | string (optional) | Date=9-9-2009 Date of planned trip. If no date is given, then current date (from a server in Portland, OR) is used. |
| Time | string (optional) | Time=10:22 am Time of planned trip. If no time is given, then current time (from a server in Portland, OR) is used. NOTE: as of now (June 2009), you will need to provide a valid time parameter/value. In a future release of this service, time will be an optional field. |
| Min | string (optional) | Arr=T -or- Arr=X -or- Arr=W Choose itineraries that offer the Quickest Trip (T); Fewest Transfers (X); or Shortest Walk (W) -- T is the default (either T or X are good options for a default in an app). Be careful with W, as it can give some round-about trips to shave off a few steps of walking (eg: I've seen it suggest taking a bus down and back, with 60 minutes extra transit time, just to avoid crossing a street). |
| Arr | string (optional) | Arr=D -or- Arr=A Depart by time / Arrive by time |
| Walk | float (optional) | Walk=0.01 -to- Walk=0.999 (in miles) |
| Mode | string (optional) | Mode=A -or- Mode=B -or- Mode=T (All Modes / Bus Only / Train Only) |
| Format | string (optional) | Format=XML -- The only format currently supported is XML. |
| MaxIntineraries | string (optional) | MaxIntineraries=1 -- The number of different itineraries to return. Default is 3 (maximum is 6). |
| appID | string (required) | Your appID received during registration. |
| Example call #1 | http://developer.trimet.org/ws/V1/trips/tripplanner/maxIntineraries/6/format/xml/fromplace/pdx/toplace/zoo/date/9-9-2009/time/2:00%20PM/arr/D/min/T/walk/0.50/mode/A/appId/YourAppIdHere Explicit URL. Note the parameters embedded in the url. Note also that parameter names are case insensitive. |
|
| Example call #2 | http://developer.trimet.org/ws/V1/trips/tripplanner/fromplace/pdx/toplace/zoo/appId/YourAppIdHere Minimal URL. |
|
| Example call #3 | http://developer.trimet.org/ws/V1/trips/tripplanner?fromCoord=-122.5931,45.587579&fromPlace=Wicked%20Cool%20Airport&toPlace=zoo&date=9/9/2009&time=2:00%20PM?appId=YourAppIdHere Here, we use both a fromCoord and a fromPlace. Note also that HTML GET parameters can also be used. |
|
Response XML:
The tripplanner ws response will conform to these two schemas.
http://maps.trimet.org/maps/model/xml/Itinerary.xsd
http://maps.trimet.org/maps/model/xml/TypeDefs.xsd
note: there are a couple of strange idioms in the response. One is that a secondary leg of a transit trip might be just an indication of a vehicle headsign change (becase the vehicle switches route = interlines); the instruction to the customer (if given at all) in this particular case would be to 'Stay on board' the current vehicle.
For example, routes 88 and 48 are assigned a single bus, so that's a good place for thru-route interlines:
http://ride.trimet.org?from=7069&to=10011
http://developer.trimet.org/ws/V1/trips/tripplanner/fromPlace/7069/toPlace/10011/time/5:00%20pm/appID/
