# 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:

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

Target | Versions |
---|---|

.NET Standard 2.0 | 100.3 - 200.4 |

.NET | 100.13 - 200.4 |

.NET Windows | 100.13 - 200.4 |

.NET Android | 200.0 - 200.4 |

.NET iOS | 200.0 - 200.4 |

.NET Framework | 100.0 - 200.4 |

Xamarin.Android | 100.0 - 100.15 |

Xamarin.iOS | 100.0 - 100.15 |

UWP | 100.0 - 200.4 |

##### Relevant samples

#### 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

Target | Versions |
---|---|

.NET Standard 2.0 | 100.3 - 200.4 |

.NET | 100.13 - 200.4 |

.NET Windows | 100.13 - 200.4 |

.NET Android | 200.2 - 200.4 |

.NET iOS | 200.0 - 200.4 |

.NET Framework | 100.1 - 200.4 |

Xamarin.Android | 100.1 - 100.14 |

Xamarin.iOS | 100.1 - 100.15 |

UWP | 100.1 - 200.3 |