Stop consolidation tool

63 views
Skip to first unread message

Sean Barbeau

unread,
Mar 7, 2016, 6:03:50 PM3/7/16
to onebusaway-developers
Hi all,
In today's OBA Board call, I promised to post about a tool we created that helps combine stops from multiple different agencies in a single OneBusAway instance into a single logical stop.  We're using this with OBA Tampa as we add a new agency.

Here's the problem we're trying to solve - if two agencies, HART and PSTA, both serve a particular location, there will be an entry in each agency's GTFS stops.txt data.  By default, these will show up as two overlapping (or very near) stops in OneBusAway - HART arrivals will appear when you tap on one stop, and PSTA arrivals will appear when you tap on the other.

Obviously, this isn't great from a usability standpoint - riders view this as a single stop, and they should be able to tap on a single stop and see arrivals for both agencies.

We are manually maintaining the mapping between the stops from each agency via a Google Spreadsheet - this makes it easy for an authorized user to update the mapping:

Stops in the same line are consolidated into the same logical stop in OneBusAway (note there is a third agency for the USF Bull Runner as well).

We created a Java command-line application to export the contents of the Google Doc:

...into a configuration file that OBA uses at bundle build time to combine the stops - here's example output of the configuration file:

Sean

Sean Barbeau
Center for Urban Transportation Research
University of South Florida

Sheldon A. Brown

unread,
Mar 8, 2016, 5:16:28 AM3/8/16
to onebusaway...@googlegroups.com
Thanks Sean!

For Sound Transit, we do something similar. As part of the bundle
build process, we run a bundle task that recommends stops for
consolidation:
https://github.com/camsys/onebusaway-application-modules/blob/sound/onebusaway-admin-webapp/src/main/resources/org/onebusaway/transit_data_federation/bundle/application-context-bundle-admin.xml#L124

(All credit to Brian Ferris for the algorithm -- I just found it in
the code base. In the future we hope to add hints to it to ignore
stops that can't be consolidated to clean up the results.)

This outputs a CSV report of stops to consider for consolidation. We
then edit the stop consolidation file (shown below) on the wiki, and
configure the entity replacement just as you have:

https://raw.githubusercontent.com/wiki/camsys/onebusaway-application-modules/PugetSoundStopConsolidation.md

We further run a task to make sure the stops we consolidated actually
behaved as expected. Sometimes stops go missing from agencies ;)

https://github.com/camsys/onebusaway-application-modules/blob/sound/onebusaway-admin-webapp/src/main/resources/org/onebusaway/transit_data_federation/bundle/application-context-bundle-admin.xml#L465

This outputs another CSV file, an entry for each line of the stop
consolidation file that did not consolidate properly.

These two tasks are examples of the arbitrary task integration
framework that is part of the bundle build process. It allows for
workflow like this to happen to achieve optimized results. Other
examples of this task integration include the ability to archive the
input GTFS to a database:

https://github.com/camsys/onebusaway-application-modules/blob/sound/onebusaway-admin-webapp/src/main/resources/org/onebusaway/transit_data_federation/bundle/application-context-bundle-admin.xml#L480

...and build a unified set of GTFS from the input sets of GTFS:

https://github.com/camsys/onebusaway-application-modules/blob/sound/onebusaway-admin-webapp/src/main/resources/org/onebusaway/transit_data_federation/bundle/application-context-bundle-admin.xml#L189

We have this workflow plugged into the admin bundle builder webapp, so
its just a few clicks to build a bundle.

Sheldon
> --
> You received this message because you are subscribed to the Google Groups
> "onebusaway-developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to onebusaway-devel...@googlegroups.com.
> To post to this group, send email to onebusaway...@googlegroups.com.
> Visit this group at https://groups.google.com/group/onebusaway-developers.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages