Skip to content

Commit

Permalink
Merge pull request #572 from ibi-group/add-stoptime-interpolation
Browse files Browse the repository at this point in the history
Support Stop Time Interpolation
  • Loading branch information
philip-cline authored Nov 21, 2023
2 parents b3b79fe + c3df9ca commit d5b2522
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
<groupId>com.github.conveyal</groupId>
<artifactId>gtfs-lib</artifactId>
<!-- Latest dev build on jitpack.io -->
<version>9bc752d3ef</version>
<version>b657dfe7d7</version>
<!-- Exclusions added in order to silence SLF4J warnings about multiple bindings:
http://www.slf4j.org/codes.html#multiple_bindings
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private String cascadeDeleteStop(Request req, Response res) {
int stopSequence = patternStop.getValue();
// Begin with the stop prior to the one deleted, unless at the beginning.
int beginWithSequence = (stopSequence != 0) ? stopSequence - 1 : stopSequence;
tableWriter.normalizeStopTimesForPattern(patternStop.getKey(), beginWithSequence);
tableWriter.normalizeStopTimesForPattern(patternStop.getKey(), beginWithSequence, false);
}
}
}
Expand Down Expand Up @@ -406,8 +406,9 @@ private String updateStopTimesFromPatternStops (Request req, Response res) {
int patternId = getIdFromRequest(req);
try {
int beginStopSequence = Integer.parseInt(req.queryParams("stopSequence"));
boolean interpolateStopTimes = Boolean.parseBoolean(req.queryParams("interpolateStopTimes"));
JdbcTableWriter tableWriter = new JdbcTableWriter(table, datasource, namespace);
int stopTimesUpdated = tableWriter.normalizeStopTimesForPattern(patternId, beginStopSequence);
int stopTimesUpdated = tableWriter.normalizeStopTimesForPattern(patternId, beginStopSequence, interpolateStopTimes);
return SparkUtils.formatJSON("updateResult", stopTimesUpdated + " stop times updated.");
} catch (Exception e) {
logMessageAndHalt(req, 400, "Error normalizing stop times", e);
Expand Down

0 comments on commit d5b2522

Please sign in to comment.