Skip to content
Simon Jacobs edited this page Apr 26, 2017 · 1 revision

The GTFS-RT interface provides bus locations, predictions, and service alerts in GTFS-RT, a widely-used open-source realtime transit data format. It is intended as an alternative to the SIRI and OBA APIs.

onebusaway-nyc-gtfsrt-webapp

This module provides the web application that serves GTFS-RT.

Java
  • org.onebusaway.nyc.gtfsrt.controller - classes for the entry points for GTFS-RT
    • GtfsRealtimeController - entry points for TripUpdate, VehiclePosition, Alert
    • BundleManagementController - allows bundle to be switched via API call, used by integration tests
    • BundleManagementInterceptor - based on configuration, forbid access to BundleManagementController. Default is forbidden. This value should only be overridden for integration tests.
Configuration files
  • application-context-webapp.xml - General Spring context for this module.
  • data-sources.xml - Spring data source configuration including Transit Data Service, Config Service, database, etc.
  • git.properties - Provides version number and other Git attributes
  • log4j-stdout.xml, log4j.xml - Log4j configuration files
Web Application Files
  • web.xml - Web context configuration file
  • remoting-servlet.xml - configuration for Java servlet.
onebusaway-nyc-gtfsrt

This module provides classes which translate from OBA internal model classes into GTFS-RT.

Java
  • org.onebusaway.nyc.gtfsrt.service - services which are instantiated by Spring
    • FeedMessageService - provide a feed message (TripUpdate, VehiclePosition, or Alert, depending on subclass)
    • ServiceAlertFeedBuilder - build a Alert from a ServiceAlertBean
    • TripUpdateFeedBuilder - build a TripUpdate from a TripBean, VehicleStatusBean, and a list of TimepointPredictionRecord.
    • VehicleUpdateFeedBuilder - build a VehiclePosition from VehicleStatusBean and VehicleLocationRecordBean.
  • org.onebusaway.nyc.gtfsrt.impl - implementations of the above classes. Note FeedMessageService has three subclasses for each type of message, as well as an abstract class AbstractFeedMessageService which contains shared logic for building feeds.
  • org.onebusaway.nyc.gtfsrt.util - classes for reading in archived inferred locations, service alerts, and block-trip mapping files. These classes are used by unit tests and integration tests.
onebusaway-nyc-gtfsrt-lib

This module includes library classes for creating GTFS-RT, so that this logic can be easily re-used in other related projects.

Java
  • org.onebusaway.nyc.gtfsrt.util.GtfsRealtimeLibrary - includes static methods for converting OBA model classes into GTFS-RT.
  • org.onebusaway.nyc.transit_data_manager.util.NycSiriUtil - includes static methods for converting service alert in SIRI XML format into OBA model classes. The original location of this class was in onebusaway-nyc-tdm-adapters.
Clone this wiki locally