File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
modules/core/src/main/java/org/locationtech/jts/triangulate Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments