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(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 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.0 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 100.15
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(IEnumerable<Geometry> geometries)
Parameters
Type Name Description
IEnumerable<Geometry> geometries

A collection of geometries.

Returns
Type Description
Geometry

The union of all the geometries in the given collection.

Remarks

There must be at least one geometry in the given collection. The geometries must have consistent spatial references. If the collection contains geometries of differing dimensionality, returns the union of the subset of geometries with the highest dimensionality. E.g. given a collection of polygons, polylines and points, returns the union of the polygons.

Supports true curves.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.1 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Xamarin.Android100.1 - 100.15
Xamarin.iOS100.1 - 100.15
UWP100.1 - 100.14
In This Article
Back to top Copyright © 2022 Esri.