GEOS  3.13.0dev
Public Member Functions | Static Public Member Functions | List of all members
geos::algorithm::MinimumAreaRectangle Class Reference

#include <MinimumAreaRectangle.h>

Public Member Functions

 MinimumAreaRectangle (const Geometry *inputGeom)
 
 MinimumAreaRectangle (const Geometry *inputGeom, bool isConvex)
 

Static Public Member Functions

static std::unique_ptr< GeometrygetMinimumRectangle (const Geometry *geom)
 

Detailed Description

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 MinimumDiameter to compute this.

See also
MinimumDiameter
ConvexHull

Constructor & Destructor Documentation

◆ MinimumAreaRectangle() [1/2]

geos::algorithm::MinimumAreaRectangle::MinimumAreaRectangle ( const Geometry inputGeom)
inline

Compute a minimum-area rectangle for a given Geometry.

Parameters
inputGeoma Geometry

◆ MinimumAreaRectangle() [2/2]

geos::algorithm::MinimumAreaRectangle::MinimumAreaRectangle ( const Geometry inputGeom,
bool  isConvex 
)
inline

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).

Parameters
inputGeoma Geometry which is convex
isConvextrue if the input geometry is convex

Member Function Documentation

◆ getMinimumRectangle()

static std::unique_ptr<Geometry> geos::algorithm::MinimumAreaRectangle::getMinimumRectangle ( const Geometry geom)
static

Gets the minimum-area rectangular Polygon which encloses the input geometry. If the convex hull of the input is degenerate (a line or point) a LineString or Point is returned.

Parameters
geomthe geometry
Returns
the minimum rectangle enclosing the geometry

The documentation for this class was generated from the following file: