Skip to content

Commit

Permalink
Merge pull request #141 from omnimodal/gtfs-debug-output
Browse files Browse the repository at this point in the history
Add config to use outputPathsAndStopsForGraphing debug function without recompile
  • Loading branch information
scrudden authored May 13, 2019
2 parents 521baed + d4f28ae commit ce19a28
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions transitclock/src/main/java/org/transitclock/gtfs/GtfsData.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.util.regex.Pattern;

import org.hibernate.HibernateException;


import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
Expand Down Expand Up @@ -256,6 +256,14 @@ public class GtfsData {
+ "name of the last stop, won't disambiguate if the last "
+ "stops for the trips with the same headsign differ by "
+ "less than this amount.");

private static StringConfigValue outputPathsAndStopsForGraphingRouteIds =
new StringConfigValue("transitclock.gtfs.outputPathsAndStopsForGraphingRouteIds",
null, // Default of null means don't output any routes
"Outputs data for specified routes grouped by trip pattern."
+ "The resulting data can be visualized on a map by cutting"
+ "and pasting it in to http://www.gpsvisualizer.com/map_input"
+ "Separate multiple route ids with commas");

// Logging
public static final Logger logger =
Expand Down Expand Up @@ -2546,6 +2554,16 @@ public ConfigRevision getConfigRevision() {

/*************************** Main Public Methods **********************/

public void outputRoutesForGraphing() {
if (outputPathsAndStopsForGraphingRouteIds.getValue() == null)
return;

String[] routeIds = outputPathsAndStopsForGraphingRouteIds.getValue().split(",");
for (String routeId : routeIds) {
outputPathsAndStopsForGraphing(routeId);
}
}

/**
* Outputs data for specified route grouped by trip pattern.
* The resulting data can be visualized on a map by cutting
Expand Down Expand Up @@ -2701,8 +2719,8 @@ public void processData() {
// MBTA commuter rail.
trimCalendars();

// debugging
//outputPathsAndStopsForGraphing("8699");
// Optionally output routes for debug graphing
outputRoutesForGraphing();

// Now process travel times and update the Trip objects.
TravelTimesProcessorForGtfsUpdates travelTimesProcesssor =
Expand Down

0 comments on commit ce19a28

Please sign in to comment.