Skip to content
Sean Barbeau edited this page Dec 4, 2013 · 7 revisions

NOTE this is a recent change and the information applies to the master branch (i.e. the version of OTP whose modules are named otp-* rather than opentripplanner-*) not the stable branch.

OTP is moving away from using Spring to wire together and configure its components. In multi-graph operation, rather than one big XML file for the entire server with nested elements configuring each individual graph, we have moved some of the graph- or router-specific information to simple properties files that are stored alongside the graph in the same directory.

Currently this method is used to configure long-running "graph updater" threads, which pull in information of various kinds (rental bicycle counts, real-time vehicle position updates) in various ways (HTTP polling, streaming over websockets).

To configure graph updaters, create a file named Graph.properties in the same directory as the Graph.obj to which the updates apply. Its contents look something like:

# Bike rental updater for City Bikes
bike1.type = bike-rental
bike1.frequencySec = 300
bike1.sourceType = city-bikes
bike1.url = http://host.domain.tld

This creates an updater called bike1, specifying what kind of information it fetches, the URL it will poll, and how often it polls for updates. You can choose the name of each updater (the first part of its hierarchical name) arbitrarily. It simply serves to distinguish between separate updaters. To add a second bike rental organization associated to the same graph, you would follow the same pattern but use a different prefix in place of 'bike1'.

Currently, for bike rental, the valid values of "sourceType" and their implementation classes are:

  • jcdecaux
  • b-cycle
  • bixi
  • keolis-rennes
  • ov-fiets
  • city-bikes

B-cycle requires an Api Key and this patch https://github.com/opentripplanner/OpenTripPlanner/issues/1285 (if it is not already in the Master Branch)

bike1.apiKey = ........

Currently, the valid values of "type" and their implementation classes are:

  • bike-rental BikeRentalUpdater();
  • stop-time-updater PollingStoptimeUpdater();
  • websocket-gtfs-rt-updater WebsocketGtfsRealtimeUpdater();
  • real-time-alerts GtfsRealtimeAlertsUpdater();
  • example-updater ExampleGraphUpdater();
  • example-polling-updater ExamplePollingGraphUpdater();

GTFS-RT incremental over a websocket

This type of endpoint is provided by the OneBusAway GTFS-realtime exporter project. It provides streaming, incremental GTFS-RT rather than a single large file. The defaultAgencyId is used for matching incoming messages to those in a GTFS feed.

mywebsocket.type = websocket-gtfs-rt-updater
mywebsocket.defaultAgencyId = <your agency>
mywebsocket.url = ws://localhost:8088/tripUpdates

Polling for GTFS-RT trip (stop time) updates

rt.type = stop-time-updater 
rt.frequencySec = 60 
rt.source.type = gtfs-http 
rt.source.url = http://domain.tld/stop-times 
rt.source.defaultAgencyId = TA1 

Polling for GTFS-RT alerts

alerts.type = real-time-alerts 
alerts.frequencySec = 120 
alerts.source.url = http://domain.tld/alerts 
alerts.source.earlyStartSec = 3600 
alerts.source.defaultAgencyId = TA1 
Clone this wiki locally