intersection static method

List<Coordinate> intersection(
  1. List<Coordinate> coordinates,
  2. Envelope env
)

Extracts the coordinates which intersect an {@link Envelope}.

@param coordinates the coordinates to scan @param env the envelope to intersect with @return an array of the coordinates which intersect the envelope

Implementation

static List<Coordinate> intersection(
    List<Coordinate> coordinates, Envelope env) {
  List<Coordinate> coordList = [];
  for (int i = 0; i < coordinates.length; i++) {
    if (env.intersectsCoordinate(coordinates[i]))
      coordList.add(coordinates[i]);
  }
  return coordList;
}