Package org.goplanit.gtfs.util
Class GtfsRoutedServicesModifierUtils
- java.lang.Object
-
- org.goplanit.gtfs.util.GtfsRoutedServicesModifierUtils
-
public class GtfsRoutedServicesModifierUtils extends Object
Some utilities on modifying the routed services as it is convenient for the GTFS parser
-
-
Constructor Summary
Constructors Constructor Description GtfsRoutedServicesModifierUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
groupIdenticallyScheduledPlanitTrips(RoutedServices routedServices)
PLANit routed services trips that have identical relative schedules (but different departure times) will be grouped together rather than continue to exist as separate trips.static void
removeDuplicateTripDepartures(RoutedServices routedServices)
In case trips have duplicate departures, we can remove these departures.static void
removeEmptyRoutedServices(RoutedServices routedServices)
In case any layers end up with no services, we can remove these layers.static void
removeScheduledTripsWithoutLegs(RoutedServices routedServices)
Given that due to time period and day based filtering it is possible some GTFS trips only end up with a single stop, which means they have no valid leg timings.static void
removeServiceRoutesWithoutTrips(RoutedServices routedServices)
Given that due to time period and day based filtering it is likely that GTFS routes triggered creation of PLANit services which eventually did not get mapped to any eligible trips in which case, this method can be used to clean up, i.e., remove those services (and we recreate their underlying ids)
-
-
-
Method Detail
-
groupIdenticallyScheduledPlanitTrips
public static void groupIdenticallyScheduledPlanitTrips(RoutedServices routedServices)
PLANit routed services trips that have identical relative schedules (but different departure times) will be grouped together rather than continue to exist as separate trips.In case anything else uses the ids or XML ids of routed trips or their departures, handlers should be created that are called back when these ids change during the course of this method, since the ids will be recreated and many PLANit trips might get removed
- Parameters:
routedServices
- to apply to for across all its layers
-
removeScheduledTripsWithoutLegs
public static void removeScheduledTripsWithoutLegs(RoutedServices routedServices)
Given that due to time period and day based filtering it is possible some GTFS trips only end up with a single stop, which means they have no valid leg timings. This method can be used to clean up, i.e., remove those trips (and we recreate their underlying ids)- Parameters:
routedServices
- to prune
-
removeServiceRoutesWithoutTrips
public static void removeServiceRoutesWithoutTrips(RoutedServices routedServices)
Given that due to time period and day based filtering it is likely that GTFS routes triggered creation of PLANit services which eventually did not get mapped to any eligible trips in which case, this method can be used to clean up, i.e., remove those services (and we recreate their underlying ids)- Parameters:
routedServices
- to prune
-
removeEmptyRoutedServices
public static void removeEmptyRoutedServices(RoutedServices routedServices)
In case any layers end up with no services, we can remove these layers. This is done here- Parameters:
routedServices
- to prune
-
removeDuplicateTripDepartures
public static void removeDuplicateTripDepartures(RoutedServices routedServices)
In case trips have duplicate departures, we can remove these departures. This is done here- Parameters:
routedServices
- to prune
-
-