WorldBank-Transport / open-transit-indicators

An open-source tool to support transport agencies in planning and managing public transit systems
GNU General Public License v3.0
44 stars 21 forks source link

Parse direction_id, use in avg. service frequency #660

Closed ddohler closed 9 years ago

ddohler commented 9 years ago

Trips in opposite directions were causing the average service frequency indicator (which is actually headway) to report numbers that were roughly 50% too low when the inbound and outbound trips shared stops as in metro or train service. Bus service was usually not affected because bus stops are usually split between inbound and outbound service when they are on opposite sides of the street. This parses out the direction_id parameter from GTFS feeds, when it exists, and groups the trips by direction_id when calculating the service frequency.

If the direction_id doesn't exist in the gtfs file, all trips will be grouped together, so if there are opposite direction trips which share the same stop, the service frequency at that stop will be artificially reduced.

Note that user-generated scenarios will not benefit from this change because the scenario editor doesn't have any concept of trip directionality, and therefore all trips will be grouped together.

ddohler commented 9 years ago

SEPTA rail before: otiprefrequencyfix

SEPTA rail after: otipostfrequencyfix

kshepard commented 9 years ago

+1, nice! If you haven't already, I think it'd be good to try this out with Zhengzhou data to verify that the updated numbers look more sensible.

ddohler commented 9 years ago

The problem with the Zhengzhou data is that it's from a scenario, so this fix won't really affect it because we don't have any way to edit trip directions in scenarios. The good news is that with scenarios, it's relatively straightforward to fix this problem by manually creating separate stations for inbound and outbound trips.