getCoordinates method

List<Coordinate> getCoordinates()
override

Collects all coordinates of all subgeometries into an Array.

Note that while changes to the coordinate objects themselves may modify the Geometries in place, the returned Array as such is only a temporary container which is not synchronized back.

@return the collected coordinates

Implementation

List<Coordinate> getCoordinates() {
  List<Coordinate> coordinates = []; //..length = getNumPoints();
  // int k = -1;
  for (int i = 0; i < geometries.length; i++) {
    List<Coordinate> childCoordinates = geometries[i].getCoordinates();
    for (int j = 0; j < childCoordinates.length; j++) {
      // k++;
      // coordinates[k] = childCoordinates[j];
      coordinates.add(childCoordinates[j]);
    }
  }
  return coordinates;
}