Show / Hide Table of Contents

Method ConvexHull

ConvexHull(Geometry)

Calculates the minimum bounding geometry (convex hull) that completely encloses the given geometry.

Declaration
public static Geometry ConvexHull(this Geometry geometry)
Parameters
Type Name Description
Geometry geometry

The input geometry.

Returns
Type Description
Geometry

The minimum bounding geometry that completely encloses the given geometry.

Remarks

The convex hull is the minimal bounding geometry, consisting of straight segments, that encloses the input geometry, such that all outer angles are convex. If you imagine a rubber band stretched around the input geometry, the rubber band takes the shape of the convex hull.

When a geometry contains curves, the computed convex hull will still consist of straight segments, not curves, so may not fit tightly to the geometry.

Convex hull diagram.

Exceptions
Type Condition
System.NotImplementedException

A true curve geometry was used as input when it is not supported by this operation.

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
Convex hull: Create a convex hull for a given set of points. The convex hull is a polygon with shortest perimeter that encloses a set of points. As a visual analogy, consider a set of points as nails in a board. The convex hull of the points would be like a rubber band stretched around the outermost nails.

ConvexHull(IEnumerable<Geometry>, Boolean)

Calculates the minimum bounding straight-edged geometry (convex hull) for the geometries in the given collection.

Declaration
public static IEnumerable<Geometry> ConvexHull(this IEnumerable<Geometry> geometries, bool merge)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Geometry> geometries

A collection of geometries.

System.Boolean merge

true indicates that a single convex hull geometry is calculated that encloses all the geometries in the collection as a single geometry in an array. false indicates that an array of convex hull geometries is calculated, one bounding each of the geometries in the input collection.

Returns
Type Description
System.Collections.Generic.IEnumerable<Geometry>

The minimum bounding straight-edged geometry that completely encloses the geometries in the given collection. If merge is true, returns a single convex hull that encloses all the geometries in the collection as a list with a single geometry. If merge is false, returns a list of convex hull geometries, one bounding each of the geometries in the input collection. If geometries is empty, returns an empty enumerable.

Remarks

When input geometries contain curves, the computed convex hull will still consist of straight segments, not curves, so may not fit tightly to the geometry.

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
Relevant samples
Convex hull list: Generate convex hull polygon(s) from multiple input geometries.
In This Article
Back to top Copyright © 2022 Esri.