public class ConvexHull extends Object
Geometry
.
The convex hull is the smallest convex Geometry that contains all the
points in the input Geometry.
Uses the Graham Scan algorithm.
Incorporates heuristics to optimize checking for degenerate results, and to reduce the number of points processed for large inputs.
Constructor and Description |
---|
ConvexHull(Coordinate[] pts,
GeometryFactory geomFactory)
Create a new convex hull construction for the input
Coordinate array. |
ConvexHull(Geometry geometry)
Create a new convex hull construction for the input
Geometry . |
Modifier and Type | Method and Description |
---|---|
Geometry |
getConvexHull()
Returns a
Geometry that represents the convex hull of the input
geometry. |
public ConvexHull(Geometry geometry)
Geometry
.public ConvexHull(Coordinate[] pts, GeometryFactory geomFactory)
Coordinate
array.public Geometry getConvexHull()
Geometry
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.Polygon
;
2 points, a LineString
;
1 point, a Point
;
0 points, an empty GeometryCollection
.Copyright © 2024. All rights reserved.