Class: MinimumDiameter

jsts.algorithm.MinimumDiameter

new MinimumDiameter()

Computes the minimum diameter of a 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.

Version:
  • 1.7
Source:
See:
  • ConvexHull

Methods

getDiameter() → {jsts.geom.LineString}

Gets a LineString which is a minimum diameter
Source:
Returns:
a LineString which is a minimum diameter
Type
jsts.geom.LineString

getLength() → {number}

Gets the length of the minimum diameter of the input Geometry
Source:
Returns:
the length of the minimum diameter
Type
number

getMinimumRectangle() → {jsts.geom.Geometry}

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

Source:
Returns:
the minimum rectangle enclosing the input (or a line or point if degenerate)
Type
jsts.geom.Geometry

getSupportingSegment() → {jsts.geom.LineString}

Gets the segment forming the base of the minimum diameter
Source:
Returns:
the segment forming the base of the minimum diameter
Type
jsts.geom.LineString

getWidthCoordinate() → {jsts.geom.Coordinate}

Gets the Coordinate forming one end of the minimum diameter
Source:
Returns:
a coordinate forming one end of the minimum diameter
Type
jsts.geom.Coordinate