Skip to content

Commit

Permalink
Add flag to crop regional destinations to origins
Browse files Browse the repository at this point in the history
  • Loading branch information
ansoncfit committed Apr 17, 2024
1 parent 566c08c commit 661e59a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/com/conveyal/r5/analyst/cluster/RegionalTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down Expand Up @@ -109,4 +112,8 @@ public int nTargetsPerOrigin () {
}
}

public boolean hasFlag (String flag) {
return this.flags != null && this.flags.contains(flag);
}

}

0 comments on commit 661e59a

Please sign in to comment.