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); + } + }