Package org.h2gis.functions.spatial.mesh
Class FullConvexHull
- java.lang.Object
-
- org.h2gis.functions.spatial.mesh.FullConvexHull
-
public class FullConvexHull extends Object
Computes the convex hull of aGeometry. The convex hull is the smallest convex Geometry that contains all the points in the input Geometry.Uses the Graham Scan algorithm. For the workaround of Poly2Tri the convex hull must not be simplified
- Version:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description FullConvexHull(org.locationtech.jts.geom.Coordinate[] pts, org.locationtech.jts.geom.GeometryFactory geomFactory)Create a new convex hull construction for the inputCoordinatearray.FullConvexHull(org.locationtech.jts.geom.Geometry geometry)Create a new convex hull construction for the inputGeometry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.GeometrygetConvexHull()Returns aGeometrythat represents the convex hull of the input geometry.protected org.locationtech.jts.geom.Coordinate[]toCoordinateArray(Stack stack)An alternative to Stack.toArray, which is not present in earlier versions of Java.
-
-
-
Constructor Detail
-
FullConvexHull
public FullConvexHull(org.locationtech.jts.geom.Geometry geometry)
Create a new convex hull construction for the inputGeometry.- Parameters:
geometry-
-
FullConvexHull
public FullConvexHull(org.locationtech.jts.geom.Coordinate[] pts, org.locationtech.jts.geom.GeometryFactory geomFactory)Create a new convex hull construction for the inputCoordinatearray.
-
-
Method Detail
-
getConvexHull
public org.locationtech.jts.geom.Geometry getConvexHull()
Returns aGeometrythat 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 org.locationtech.jts.geom.Coordinate[] toCoordinateArray(Stack stack)
An alternative to Stack.toArray, which is not present in earlier versions of Java.- Parameters:
stack-
-
-