Package org.locationtech.jts.algorithm
Class ConvexHull
- java.lang.Object
-
- org.locationtech.jts.algorithm.ConvexHull
-
-
Constructor Summary
Constructors Constructor Description ConvexHull(Coordinate[] pts, GeometryFactory geomFactory)
Create a new convex hull construction for the inputCoordinate
array.ConvexHull(Geometry geometry)
Create a new convex hull construction for the inputGeometry
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Geometry
getConvexHull()
Returns aGeometry
that represents the convex hull of the input geometry.protected Coordinate[]
toCoordinateArray(Stack stack)
An alternative to Stack.toArray, which is not present in earlier versions of Java.
-
-
-
Constructor Detail
-
ConvexHull
public ConvexHull(Geometry geometry)
Create a new convex hull construction for the inputGeometry
.
-
ConvexHull
public ConvexHull(Coordinate[] pts, GeometryFactory geomFactory)
Create a new convex hull construction for the inputCoordinate
array.
-
-
Method Detail
-
getConvexHull
public Geometry getConvexHull()
Returns aGeometry
that represents the convex hull of the input geometry. The returned geometry contains the minimal number of points needed to represent the convex hull. In particular, no more than two consecutive points will be collinear.- Returns:
- if the convex hull contains 3 or more points, a
Polygon
; 2 points, aLineString
; 1 point, aPoint
; 0 points, an emptyGeometryCollection
.
-
toCoordinateArray
protected Coordinate[] toCoordinateArray(Stack stack)
An alternative to Stack.toArray, which is not present in earlier versions of Java.
-
-