From 566c08caccac12b5c3a65d5e320adb585cd3aa21 Mon Sep 17 00:00:00 2001 From: ansons Date: Fri, 16 Feb 2024 16:19:15 -0500 Subject: [PATCH 1/2] Force regional destinations to be cropped to origins --- .../java/com/conveyal/r5/analyst/cluster/RegionalTask.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java b/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java index 0a444f9aa..2545db409 100644 --- a/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java +++ b/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java @@ -74,11 +74,8 @@ public Type getType() { */ @Override public WebMercatorExtents getWebMercatorExtents() { - if (makeTauiSite) { - return WebMercatorExtents.forTask(this); - } else { - return WebMercatorExtents.forPointsets(this.destinationPointSets); - } + return WebMercatorExtents.forTask(this); + // TODO Use previous conditional logic with custom flag (request.flags.CROP_DESTINATIONS) } /** From 661e59a82b6816ff89eba53a48049917d36a1bfd Mon Sep 17 00:00:00 2001 From: ansons Date: Wed, 17 Apr 2024 13:45:01 -0400 Subject: [PATCH 2/2] Add flag to crop regional destinations to origins --- .../com/conveyal/r5/analyst/cluster/RegionalTask.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java b/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java index 2545db409..839bdde91 100644 --- a/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java +++ b/src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java @@ -74,8 +74,11 @@ public Type getType() { */ @Override public WebMercatorExtents getWebMercatorExtents() { - return WebMercatorExtents.forTask(this); - // TODO Use previous conditional logic with custom flag (request.flags.CROP_DESTINATIONS) + if (makeTauiSite || this.hasFlag("CROP_DESTINATIONS")) { + return WebMercatorExtents.forTask(this); + } else { + return WebMercatorExtents.forPointsets(this.destinationPointSets); + } } /** @@ -109,4 +112,8 @@ public int nTargetsPerOrigin () { } } + public boolean hasFlag (String flag) { + return this.flags != null && this.flags.contains(flag); + } + }