From 9994a7c871244bdaf1c5fc69b367e13eb06a6adf Mon Sep 17 00:00:00 2001 From: "philip.cline" Date: Sun, 5 Nov 2023 14:32:45 -0500 Subject: [PATCH 1/4] feat(EditorController): Support stop time normalization --- .../datatools/editor/controllers/api/EditorController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/conveyal/datatools/editor/controllers/api/EditorController.java b/src/main/java/com/conveyal/datatools/editor/controllers/api/EditorController.java index bd50dff8f..671466860 100644 --- a/src/main/java/com/conveyal/datatools/editor/controllers/api/EditorController.java +++ b/src/main/java/com/conveyal/datatools/editor/controllers/api/EditorController.java @@ -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); } } } @@ -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); From 26d462eb5a2227b1c79c8db294c20a509df54a76 Mon Sep 17 00:00:00 2001 From: "philip.cline" Date: Sun, 5 Nov 2023 14:37:37 -0500 Subject: [PATCH 2/4] refactor(deps): Update to use appropriate gtfs-lib --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5f5a80fe2..43c5a8182 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ com.github.conveyal gtfs-lib - 80a968cd3a071aa46a994ce2632535303a6e4384 + 5f34e048ab92936b98e344e69d8a41c9cf978dc4 From 9d0ca4f8b091090696461f602756b9ff459524e3 Mon Sep 17 00:00:00 2001 From: "philip.cline" Date: Tue, 21 Nov 2023 15:03:04 -0500 Subject: [PATCH 3/4] chore(deps): update gtfs-lib commit after merge --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 43c5a8182..3806912d1 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ com.github.conveyal gtfs-lib - 5f34e048ab92936b98e344e69d8a41c9cf978dc4 + b657dfe7d7c75eacfbc165cf37c0c0ff3f8cd23e From 8828781bdadd255122b91dbee04aa27407e9cc28 Mon Sep 17 00:00:00 2001 From: "philip.cline" Date: Tue, 21 Nov 2023 15:07:10 -0500 Subject: [PATCH 4/4] chore(deps): fix gtfs-lib commit after merge --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3806912d1..bf2c081f0 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ com.github.conveyal gtfs-lib - b657dfe7d7c75eacfbc165cf37c0c0ff3f8cd23e + b657dfe7d7