Class MinimumAreaRectangle
Computes the minimum-area rectangle enclosing a Geometry. Unlike the Envelope, the rectangle may not be axis-parallel.
The first step in the algorithm is computing the convex hull of the Geometry. If the input Geometry is known to be convex, a hint can be supplied to avoid this computation. In degenerate cases the minimum enclosing geometry may be a LineString or a Point. The minimum - area enclosing rectangle does not necessarily have the minimum possible width. Use {@link MinimumDiameter} to compute this.Inherited Members
Namespace: NetTopologySuite.Algorithm
Assembly: NetTopologySuite.dll
Syntax
public sealed class MinimumAreaRectangle
Constructors
| Edit this page View SourceMinimumAreaRectangle(Geometry)
Compute a minimum-area rectangle for a given {@link Geometry}.
Declaration
public MinimumAreaRectangle(Geometry inputGeom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | inputGeom | A Geometry |
MinimumAreaRectangle(Geometry, bool)
Compute a minimum rectangle for a Geometry, with a hint if the geometry is convex (e.g. a convex Polygon or LinearRing, or a two-point LineString, or a Point).
Declaration
public MinimumAreaRectangle(Geometry inputGeom, bool isConvex)
Parameters
Type | Name | Description |
---|---|---|
Geometry | inputGeom | A Geometry |
bool | isConvex | A flag indicating if |
Methods
| Edit this page View SourceGetMinimumRectangle(Geometry)
Gets the minimum-area rectangular {@link Polygon} which encloses the input geometry. If the convex hull of the input is degenerate (a line or point) a {@link LineString} or {@link Point} is returned.
Declaration
public static Geometry GetMinimumRectangle(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | A Geometry |
Returns
Type | Description |
---|---|
Geometry | The minimum rectangle enclosing the geometry |