create method

CoordinateSequence create(
  1. List<Coordinate> coordinates
)
override

@see CoordinateSequenceFactory#create(List

Implementation

CoordinateSequence create(List<Coordinate> coordinates) {
  int dimension = DEFAULT_DIMENSION;
  int measures = DEFAULT_MEASURES;
  if (coordinates != null &&
      coordinates.length > 0 &&
      coordinates[0] != null) {
    Coordinate first = coordinates[0];
    dimension = Coordinates.dimension(first);
    measures = Coordinates.measures(first);
  }
  if (type == DOUBLE) {
    return Double.fromCoordinatesDimMeas(coordinates, dimension, measures);
  } else {
    throw ArgumentError("Only PackedCoordinateSequence Double supported");
  }
}