@Override
  protected Coordinate getCoordinateInternal(int index) {
    return switch (dimension) {
      case 2 -> new CoordinateXY(getX(index), getY(index));
      case 3 -> new Coordinate(getX(index), getY(index), getZ(index));
      case 4 -> new CoordinateXYZM(getX(index), getY(index), getZ(index), getM(index));
      default -> throw new IllegalStateException("Unexpected value: " + dimension);
    };
  }
A mutable {@link CoordinateSequence} that grows to fit new elements when {@code set*} methods are called.
planetiler-core/src/main/java/com/onthegomap/planetiler/reader/parquet/CoordinateSequenceBuilder.java