Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Stop Time Interpolation #572

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
<groupId>com.github.conveyal</groupId>
<artifactId>gtfs-lib</artifactId>
<!-- Latest dev build on jitpack.io -->
<version>80a968cd3a071aa46a994ce2632535303a6e4384</version>
<version>5f34e048ab92936b98e344e69d8a41c9cf978dc4</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
Loading