Package org.locationtech.jts.triangulate
Class DelaunayTriangulationBuilder
java.lang.Object
org.locationtech.jts.triangulate.DelaunayTriangulationBuilder
A utility class which creates Delaunay Triangulations
from collections of points and extract the resulting
triangulation edges or triangles as geometries.
- Author:
- Martin Davis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Envelope
envelope
(Collection coords) Computes theEnvelope
of a collection ofCoordinate
s.static CoordinateList
Extracts the uniqueCoordinate
s from the givenGeometry
.getEdges
(GeometryFactory geomFact) Gets the edges of the computed triangulation as aMultiLineString
.Gets theQuadEdgeSubdivision
which models the computed triangulation.getTriangles
(GeometryFactory geomFact) Gets the faces of the computed triangulation as aGeometryCollection
ofPolygon
.void
setSites
(Collection coords) Sets the sites (vertices) which will be triangulated from a collection ofCoordinate
s.void
Sets the sites (vertices) which will be triangulated.void
setTolerance
(double tolerance) Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation.static List
toVertices
(Collection coords) Converts allCoordinate
s in a collection toVertex
es.static CoordinateList
unique
(Coordinate[] coords)
-
Constructor Details
-
DelaunayTriangulationBuilder
public DelaunayTriangulationBuilder()Creates a new triangulation builder.
-
-
Method Details
-
extractUniqueCoordinates
Extracts the uniqueCoordinate
s from the givenGeometry
.- Parameters:
geom
- the geometry to extract from- Returns:
- a List of the unique Coordinates
-
unique
-
toVertices
Converts allCoordinate
s in a collection toVertex
es.- Parameters:
coords
- the coordinates to convert- Returns:
- a List of Vertex objects
-
envelope
Computes theEnvelope
of a collection ofCoordinate
s.- Parameters:
coords
- a List of Coordinates- Returns:
- the envelope of the set of coordinates
-
setSites
Sets the sites (vertices) which will be triangulated. All vertices of the given geometry will be used as sites.- Parameters:
geom
- the geometry from which the sites will be extracted.
-
setSites
Sets the sites (vertices) which will be triangulated from a collection ofCoordinate
s.- Parameters:
coords
- a collection of Coordinates.
-
setTolerance
public void setTolerance(double tolerance) Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation. A tolerance of 0.0 specifies that no snapping will take place.- Parameters:
tolerance
- the tolerance distance to use
-
getSubdivision
Gets theQuadEdgeSubdivision
which models the computed triangulation.- Returns:
- the subdivision containing the triangulation
-
getEdges
Gets the edges of the computed triangulation as aMultiLineString
.- Parameters:
geomFact
- the geometry factory to use to create the output- Returns:
- the edges of the triangulation
-
getTriangles
Gets the faces of the computed triangulation as aGeometryCollection
ofPolygon
.- Parameters:
geomFact
- the geometry factory to use to create the output- Returns:
- the faces of the triangulation
-