public class MinimumAreaRectangle extends Object
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.
MinimumDiameter
,
ConvexHull
Constructor and Description |
---|
MinimumAreaRectangle(Geometry inputGeom)
Compute a minimum-area rectangle for a given
Geometry . |
MinimumAreaRectangle(Geometry inputGeom,
boolean isConvex)
Compute a minimum rectangle for a
Geometry ,
with a hint if the geometry is convex
(e.g. |
Modifier and Type | Method and Description |
---|---|
static Geometry |
getMinimumRectangle(Geometry geom)
Gets the minimum-area rectangular
Polygon which encloses the input geometry. |
public MinimumAreaRectangle(Geometry inputGeom)
Geometry
.inputGeom
- a Geometrypublic MinimumAreaRectangle(Geometry inputGeom, boolean isConvex)
Geometry
,
with a hint if the geometry is convex
(e.g. a convex Polygon or LinearRing,
or a two-point LineString, or a Point).inputGeom
- a Geometry which is convexisConvex
- true
if the input geometry is convexpublic static Geometry getMinimumRectangle(Geometry geom)
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.geom
- the geometryCopyright © 2024. All rights reserved.