Skip to content

Commit

Permalink
Add zero-length line test
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed May 13, 2024
1 parent 1a79936 commit b427535
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
* and the boundary of a LineString has location <code>Interior</code>.
* </ul>
*
* <h3>Zero-length Line Handling</h3>
* Zero-length lines are treated as if they are a Point at the same location.
* <h3>Zero-length LineString Handling</h3>
* Zero-length LineStrings are handled as topologically identical to a Point at the same coordinate.
*
* <h2>Package Specification</h2>
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testLinePointOverlaps() {
checkCoversCoveredBy(b, a, false);
}

public void testLinePointZeroLength() {
public void testZeroLengthLinePoint() {
String a = "LINESTRING (0 0, 0 0)";
String b = "POINT (0 0)";
checkRelate(a, b, "0FFFFFFF2");
Expand All @@ -97,6 +97,18 @@ public void testLinePointZeroLength() {
checkEquals(a, b, true);
}

public void testZeroLengthLineLine() {
String a = "LINESTRING (10 10, 10 10, 10 10)";
String b = "LINESTRING (10 10, 10 10)";
checkRelate(a, b, "0FFFFFFF2");
checkIntersectsDisjoint(a, b, true);
checkContainsWithin(a, b, true);
checkContainsWithin(b, a, true);
checkCoversCoveredBy(a, b, true);
checkCoversCoveredBy(b, a, true);
checkEquals(a, b, true);
}

public void testLinePointIntAndExt() {
String a = "MULTIPOINT((60 60), (100 100))";
String b = "LINESTRING(40 40, 80 80)";
Expand Down

0 comments on commit b427535

Please sign in to comment.