Skip to content

Commit

Permalink
Fix MultiPoint to check isValid properly (#700)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Davis <mtnclimb@gmail.com>
  • Loading branch information
dr-jts committed Mar 12, 2021
1 parent 3ddd7d6 commit 776301f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ protected MultiPoint reverseInternal() {
}
return new MultiPoint(points, factory);
}

public boolean isValid() {
return true;
}

public boolean equalsExact(Geometry other, double tolerance) {
if (!isEquivalentClass(other)) {
Expand Down
20 changes: 19 additions & 1 deletion modules/tests/src/test/resources/testxml/general/TestValid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</case>

<case>
<desc>P - repeated points</desc>
<desc>mP - repeated points</desc>
<a>
MULTIPOINT((10 10), (20 20), (30 30), (10 10))
</a>
Expand All @@ -69,6 +69,16 @@
</test>
</case>

<case>
<desc>mP - invalid point</desc>
<a>
MULTIPOINT((10 10), (20 20), (30 30), (10 NaN))
</a>
<test>
<op name="isValid" arg1="A"> false </op>
</test>
</case>

<case>
<desc>L - empty</desc>
<a>
Expand Down Expand Up @@ -141,6 +151,14 @@ LINESTRING (40 180, 120 120, 140 200, 140 200, 200 140, 240 200)
</test>
</case>

<case>
<desc>mL - MultiLinestring with invalid point</desc>
<a>MULTILINESTRING((1 1, 2 NaN, 0 0))</a>
<test>
<op name="isValid" arg1="A"> false </op>
</test>
</case>

<case>
<desc>A - zero-area polygon </desc>
<a>POLYGON ((0 0, 0 0, 0 0, 0 0, 0 0))</a>
Expand Down

0 comments on commit 776301f

Please sign in to comment.