geometryCollection method

  1. @override
void geometryCollection(
  1. WriteGeometries geometries, {
  2. Coords? type,
  3. int? count,
  4. String? name,
  5. Box? bounds,
})
override

Writes a geometry collection from the content provided by geometries.

An optional type specifies the coordinate type of geometry objects in a collection. When not provided, the type can be resolved from objects.

An optional expected count, when given, specifies the number of geometry objects in a collection. Note that when given the count MUST be exact.

Use an optional name to specify a name for a geometry (when applicable).

An optional bounds can used set a minimum bounding box for a geometry written. A writer implementation may use it or ignore it.

An example to write a geometry collection with two child geometries:

  content.geometryCollection(
      type: Coords.xy
      count: 2,
      (geom) => geom
        ..point([10.123, 20.25].xy)
        ..polygon(
          [
             [
                10.1, 10.1,
                5.0, 9.0,
                12.0, 4.0,
                10.1, 10.1,
             ].positions(Coords.xy),
          ],
        ),
    );

Implementation

@override
void geometryCollection(
  WriteGeometries geometries, {
  Coords? type,
  int? count,
  String? name,
  Box? bounds,
}) {
  _add(
    GeometryCollection<E>.build(geometries, count: count, bounds: bounds),
    name: name,
  );
}