From 59cf2461459b064a2c45040e42af4371739e14ec Mon Sep 17 00:00:00 2001 From: tanelk Date: Mon, 18 Mar 2024 10:02:16 +0200 Subject: [PATCH] Tests for collinear edges Signed-off-by: tanelk --- .../operation/overlayarea/BaseOverlayAreaTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/lab/src/test/java/org/locationtech/jts/operation/overlayarea/BaseOverlayAreaTest.java b/modules/lab/src/test/java/org/locationtech/jts/operation/overlayarea/BaseOverlayAreaTest.java index fb21729a99..17550f30d5 100644 --- a/modules/lab/src/test/java/org/locationtech/jts/operation/overlayarea/BaseOverlayAreaTest.java +++ b/modules/lab/src/test/java/org/locationtech/jts/operation/overlayarea/BaseOverlayAreaTest.java @@ -128,6 +128,20 @@ public void testVertexIntersectionOnEdge2() { "POLYGON ((40 10, 20 30, 40 50, 50 30, 40 10))"); } + public void testCollinearOverlappingEdgesPartial() { + checkIntersectionAreaSymmetric( + "POLYGON ((10 30, 30 30, 30 10, 10 10, 10 30))", + "POLYGON ((20 30, 40 30, 40 10, 20 10, 20 30))" + ); + } + + public void testCollinearOverlappingEdgesFull() { + checkIntersectionAreaSymmetric( + "POLYGON ((10 30, 50 30, 50 10, 10 10, 10 30))", + "POLYGON ((20 30, 40 30, 40 10, 20 10, 20 30))" + ); + } + protected final void checkIntersectionArea(String wktA, String wktB) { Geometry a = read(wktA); Geometry b = read(wktB);