unionCollection static method

Geometry unionCollection(
  1. {required List<Geometry> geometries}
)

Calculates the union of a collection of geometries.

The union combines those parts of the input geometries which overlap into a single geometry.

If the collection contains geometries of differing dimensionality, the geometry with the higher dimensionality is returned. For example, a polygon is returned if the given a collection contains polygons, polylines, and points.

Supports true curves.

Parameters:

  • geometries — A collection of geometries.

Return Value: The union of all the geometries in the given collection.

Implementation

static Geometry unionCollection({required List<Geometry> geometries}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreGeometries =
      geometries.toMutableArray(valueType: _ElementType.geometry);
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_unionCollection(
        coreGeometries._handle, errorHandler);
  });
  return Geometry._fromHandle(objectHandle)!;
}