GEOS
3.8.0dev

Computes the minimum diameter of a geom::Geometry. More...
#include <MinimumDiameter.h>
Public Member Functions  
MinimumDiameter (const geom::Geometry *newInputGeom)  
Compute a minimum diameter for a given Geometry. More...  
MinimumDiameter (const geom::Geometry *newInputGeom, const bool newIsConvex)  
Compute a minimum diameter for a given Geometry, with a hint if the Geometry is convex (e.g. a convex Polygon or LinearRing, or a twopoint LineString, or a Point). More...  
double  getLength () 
Gets the length of the minimum diameter of the input Geometry. More...  
geom::Coordinate *  getWidthCoordinate () 
Gets the geom::Coordinate forming one end of the minimum diameter. More...  
geom::LineString *  getSupportingSegment () 
Gets the segment forming the base of the minimum diameter. More...  
geom::LineString *  getDiameter () 
Gets a LineString which is a minimum diameter. More...  
geom::Geometry *  getMinimumRectangle () 
Gets the minimum rectangular Polygon which encloses the input geometry. More...  
Static Public Member Functions  
static geom::Geometry *  getMinimumRectangle (geom::Geometry *geom) 
Gets the minimum rectangle enclosing a geometry. More...  
static geom::Geometry *  getMinimumDiameter (geom::Geometry *geom) 
Gets the length of the minimum diameter enclosing a geometry. More...  
Computes the minimum diameter of a geom::Geometry.
The minimum diameter is defined to be the width of the smallest band that contains the geometry, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the geometry can be moved through, with a single rotation.
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.
This class can also be used to compute a line segment representing the minimum diameter, the supporting line segment of the minimum diameter, and a minimum rectangle enclosing the input geometry. This rectangle will have width equal to the minimum diameter, and have one side parallel to the supporting segment.
geos::algorithm::MinimumDiameter::MinimumDiameter  (  const geom::Geometry *  newInputGeom  ) 
Compute a minimum diameter for a given Geometry.
newInputGeom  a Geometry 
geos::algorithm::MinimumDiameter::MinimumDiameter  (  const geom::Geometry *  newInputGeom, 
const bool  newIsConvex  
) 
Compute a minimum diameter for a given Geometry, with a hint if the Geometry is convex (e.g. a convex Polygon or LinearRing, or a twopoint LineString, or a Point).
newInputGeom  a Geometry which is convex 
newIsConvex  true if the input geometry is convex 
geom::LineString* geos::algorithm::MinimumDiameter::getDiameter  (  ) 
Gets a LineString which is a minimum diameter.
double geos::algorithm::MinimumDiameter::getLength  (  ) 
Gets the length of the minimum diameter of the input Geometry.

static 
Gets the length of the minimum diameter enclosing a geometry.
geom  the geometry 
geom::Geometry* geos::algorithm::MinimumDiameter::getMinimumRectangle  (  ) 
Gets the minimum rectangular Polygon which encloses the input geometry.
The rectangle has width equal to the minimum diameter, and a longer length. If the convex hill of the input is degenerate (a line or point) a LineString or Point is returned. The minimum rectangle can be used as an extremely generalized representation for the given geometry.

static 
Gets the minimum rectangle enclosing a geometry.
geom  the geometry 
geom::LineString* geos::algorithm::MinimumDiameter::getSupportingSegment  (  ) 
Gets the segment forming the base of the minimum diameter.
geom::Coordinate* geos::algorithm::MinimumDiameter::getWidthCoordinate  (  ) 
Gets the geom::Coordinate forming one end of the minimum diameter.