summarylogtreecommitdiffstats
path: root/02-path-result-max-destinations_v6.4.patch
blob: 642df6c5555431c1c8cb151c46276084f06c37b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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];