Skip to content

Commit

Permalink
Add DelaunayTriangulationBuilder Javadoc and make internal functions …
Browse files Browse the repository at this point in the history
…non-public
  • Loading branch information
dr-jts committed Feb 26, 2025
1 parent e29d942 commit 4da0a02
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ public class DelaunayTriangulationBuilder
{
/**
* Extracts the unique {@link Coordinate}s from the given {@link Geometry}.
* Has the side effect of sorting the coordinates in XY order.
* This significantly improves the robustness of Delaunay triangulation construction.
*
* @param geom the geometry to extract from
* @return a List of the unique Coordinates
* @return a sorted list of the unique Coordinates
*/
public static CoordinateList extractUniqueCoordinates(Geometry geom)
static CoordinateList extractUniqueCoordinates(Geometry geom)
{
if (geom == null)
return new CoordinateList();
Expand All @@ -54,7 +57,15 @@ public static CoordinateList extractUniqueCoordinates(Geometry geom)
return unique(coords);
}

public static CoordinateList unique(Coordinate[] coords)
/**
* Copies a list of coordinates and ensures they are unique.
* Has the side effect of sorting the coordinates in XY order.
* This significantly improves the robustness of Delaunay triangulation construction.
*
* @param coords a list of coordinates
* @return a sorted list of unique coordinates
*/
static CoordinateList unique(Coordinate[] coords)
{
Coordinate[] coordsCopy = CoordinateArrays.copyDeep(coords);
Arrays.sort(coordsCopy);
Expand Down

0 comments on commit 4da0a02

Please sign in to comment.