summarylogtreecommitdiffstats
path: root/02-path-result-max-destinations_v6.4.patch
diff options
context:
space:
mode:
Diffstat (limited to '02-path-result-max-destinations_v6.4.patch')
-rw-r--r--02-path-result-max-destinations_v6.4.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/02-path-result-max-destinations_v6.4.patch b/02-path-result-max-destinations_v6.4.patch
new file mode 100644
index 000000000000..642df6c55554
--- /dev/null
+++ b/02-path-result-max-destinations_v6.4.patch
@@ -0,0 +1,29 @@
+diff --unified --recursive --text a/src/main/java/com/conveyal/r5/analyst/cluster/PathResult.java b/src/main/java/com/conveyal/r5/analyst/cluster/PathResult.java
+--- a/src/main/java/com/conveyal/r5/analyst/cluster/PathResult.java 2021-05-16 20:18:52.000000000 +0300
++++ b/src/main/java/com/conveyal/r5/analyst/cluster/PathResult.java 2021-10-27 11:00:31.245320268 +0300
+@@ -32,6 +32,14 @@
+
+ public class PathResult {
+
++ /**
++ * The maximum number of destinations for which we'll generate detailed path information in a single request.
++ * Detailed path information was added on to the original design, which returned a simple grid of travel times.
++ * These results are returned to the backend over an HTTP API so we don't want to risk making them too huge.
++ * This could be set to a higher number in cases where you know the result return channel can handle the size.
++ */
++ public static int maxDestinations = 5000;
++
+ private final int nDestinations;
+ /**
+ * Array with one entry per destination. Each entry is a map from a "path template" to the associated iteration
+@@ -62,8 +70,8 @@
+ // In regional analyses, return paths to all destinations
+ nDestinations = task.nTargetsPerOrigin();
+ // This limitation reflects the initial design, for use with freeform pointset destinations
+- if (nDestinations > 5000) {
+- throw new UnsupportedOperationException("Path results are limited to 5000 destinations");
++ if (nDestinations > maxDestinations) {
++ throw new UnsupportedOperationException("Number of detailed path destinations exceeds limit of " + maxDestinations);
+ }
+ }
+ iterationsForPathTemplates = new Multimap[nDestinations];