Show / Hide Table of Contents

Method Union

Union(Geometry, Geometry)

The union operation constructs the set-theoretic union of the geometries in the input array.

Declaration
public static Geometry Union(this Geometry geometry1, Geometry geometry2)
Parameters
Type Name Description
Geometry geometry1

The first geometry to union with.

Geometry geometry2

The second geometry to union with.

Returns
Type Description
Geometry

The union of the two geometries.

Remarks

GeometryEngine.Union returns all parts of the two input geometries combined into a single geometry. This means that the order of the input parameters is irrelevant. In a theoretical variable format you can think of the GeometryEngine.Union equation like:
A (Union) B = C
B (Union) A = C

The following is a visual illustration of two polygon geometries and how the output result would be from the GeometryEngine.Union operation:

GeometryEngine.Union visual examples.

If the two geometries have different dimensionality, returns a copy of the geometry with the higher dimensionality. E.g. if given a polygon and a point, returns the polygon.

Supports true curves.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7
Relevant samples
Spatial relationships: Determine spatial relationships between two geometries.

Union(IEnumerable<Geometry>)

Calculates the union of a collection of geometries

Declaration
public static Geometry Union(this IEnumerable<Geometry> geometries)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Geometry> geometries

A collection of geometries. There must be at least one geometry in the collection.

Returns
Type Description
Geometry

The union of all the geometries in the given collection.

Remarks

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.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.1 - 200.7
Xamarin.Android100.1 - 100.14
Xamarin.iOS100.1 - 100.15
UWP100.1 - 200.7
In This Article
Back to top Copyright © 2022 Esri.