GeometryCollection.withFactory constructor

GeometryCollection.withFactory(
  1. List<Geometry>? geometries,
  2. GeometryFactory factory
)

@param geometries the Geometrys for this GeometryCollection, or null or an empty array to create the empty geometry. Elements may be empty Geometrys, but not nulls.

Implementation

GeometryCollection.withFactory(
    List<Geometry>? geometries, GeometryFactory factory)
    : super(factory) {
  if (geometries == null) {
    geometries = [];
  }
  if (Geometry.hasNullElements(geometries)) {
    throw new ArgumentError("geometries must not contain null elements");
  }
  this.geometries = geometries;
}