Skip to content

Commit 4da0a02

Browse files
committed
Add DelaunayTriangulationBuilder Javadoc and make internal functions non-public
1 parent e29d942 commit 4da0a02

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

modules/core/src/main/java/org/locationtech/jts/triangulate/DelaunayTriangulationBuilder.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ public class DelaunayTriangulationBuilder
4242
{
4343
/**
4444
* Extracts the unique {@link Coordinate}s from the given {@link Geometry}.
45+
* Has the side effect of sorting the coordinates in XY order.
46+
* This significantly improves the robustness of Delaunay triangulation construction.
47+
*
4548
* @param geom the geometry to extract from
46-
* @return a List of the unique Coordinates
49+
* @return a sorted list of the unique Coordinates
4750
*/
48-
public static CoordinateList extractUniqueCoordinates(Geometry geom)
51+
static CoordinateList extractUniqueCoordinates(Geometry geom)
4952
{
5053
if (geom == null)
5154
return new CoordinateList();
@@ -54,7 +57,15 @@ public static CoordinateList extractUniqueCoordinates(Geometry geom)
5457
return unique(coords);
5558
}
5659

57-
public static CoordinateList unique(Coordinate[] coords)
60+
/**
61+
* Copies a list of coordinates and ensures they are unique.
62+
* Has the side effect of sorting the coordinates in XY order.
63+
* This significantly improves the robustness of Delaunay triangulation construction.
64+
*
65+
* @param coords a list of coordinates
66+
* @return a sorted list of unique coordinates
67+
*/
68+
static CoordinateList unique(Coordinate[] coords)
5869
{
5970
Coordinate[] coordsCopy = CoordinateArrays.copyDeep(coords);
6071
Arrays.sort(coordsCopy);

0 commit comments

Comments
 (0)