Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

False positive from Covers [robustness issue] #93

Closed
strk opened this issue Jun 17, 2015 · 3 comments
Closed

False positive from Covers [robustness issue] #93

strk opened this issue Jun 17, 2015 · 3 comments

Comments

@strk
Copy link

strk commented Jun 17, 2015

This polygon:

POLYGON((1686350.74365082 5402217.7661505,1684030.810026 5402682.520688,
1684000 5402672.31399816,1683763.966259 5402588.179891,
1681281.134295 5403807.881624,1683915.838219 5402676.741864,
1684000 5402711.41802501,1684020.618162 5402719.913077,
1687524.6533522 5404490.5663652,1687854.358551 5403919.598884,
1686350.74365082 5402217.7661505))

Is found to cover this line:

MULTILINESTRING((1686350.743650820106268 5402217.766150500625372,1686093.105016468325630 5402983.094649705104530),(1687854.358550999779254 5403919.598883999511600,1687369.017594065517187 5403968.286928134970367),(1687524.653352200053632 5404490.566365199163556,1687369.017594065517187 5403968.286928134970367),(1684020.618162000086159 5402719.913077000528574,1684028.700595478760079 5402702.259855466894805),(1684000.000000000000000 5402711.418025009334087,1684007.079341103555635 5402694.235850297845900),(1683915.838219000026584 5402676.741863999515772,1683915.710130032850429 5402659.319003639742732),(1681281.134295000229031 5403807.881624000146985,1683768.299408938968554 5402663.972678654827178),(1683763.966258999891579 5402588.179890999570489,1683768.299408938968554 5402663.972678654827178),(1684000.000000000000000 5402672.313998160883784,1683994.116886092117056 5402689.425268804654479),(1684030.810025999788195 5402682.520687999203801,1684029.580235270550475 5402702.625448844395578),(1683915.710130032850429 5402659.319003639742732,1683994.116886092117056 5402689.425268804654479),(1683915.710130032850429 5402659.319003639742732,1683768.299408938968554 5402663.972678654827178),(1683994.116886092117056 5402689.425268804654479,1684007.079341103555635 5402694.235850297845900),(1684007.079341103555635 5402694.235850297845900,1684028.700595478760079 5402702.259855466894805),(1684028.700595478760079 5402702.259855466894805,1684029.580235270550475 5402702.625448844395578),(1684029.580235270550475 5402702.625448844395578,1686093.105016468325630 5402983.094649705104530),(1687369.017594065517187 5403968.286928134970367,1686093.105016468325630 5402983.094649705104530))

While it should not.

@strk
Copy link
Author

strk commented Jun 17, 2015

The LINE may be simplified to:

LINESTRING(
 1684030.810025999788195 5402682.520687999203801,
 1684029.580235270550475 5402702.625448844395578)

@strk
Copy link
Author

strk commented Jun 17, 2015

Patch for testsuite, to show the problem:

diff --git a/test/data/CoversTest.txt b/test/data/CoversTest.txt
index 90c4fb1..45e4d6f 100644
--- a/test/data/CoversTest.txt
+++ b/test/data/CoversTest.txt
@@ -92,6 +92,11 @@
 3|POLYGON((0 0,1 0,1 1,0 1,0 0),(0.4 0.4,0.4 0.6,0.6 0.6,0.6 0.4,0.4 0.4))|MULTILINESTRING((0 0,0.4 0.4),(0.6 0.6,0.8 0.8))|true
 3|POLYGON((0 0,1 0,1 1,0 1,0 0),(0.4 0.4,0.4 0.6,0.6 0.6,0.6 0.4,0.4 0.4))|LINESTRING(0.5 0.5,1 1)|false

+# Polygon|MultiLineString
+2|POLYGON((0 0,1 0,1 1,0 1,0 0),(0.4 0.4,0.4 0.6,0.6 0.6,0.6 0.4,0.4 0.4))|MULTILINESTRING((0 0,0.2 0.2))|true
+2|POLYGON((0 0,1 0,1 1,0 1,0 0),(0.4 0.4,0.4 0.6,0.6 0.6,0.6 0.4,0.4 0.4))|MULTILINESTRING((0 0,0.2 0.2),(-1 1,1 1))|false
+2|POLYGON((1686350.74365082 5402217.7661505,1684030.810026 5402682.520688,1684000 5402672.31399816,1683763.966259 5402588.179891,1681281.134295 5403807.881624,1683915.838219 5402676.741864,1684000 5402711.41802501,1684020.618162 5402719.913077,1687524.6533522 5404490.5663652,1687854.358551 5403919.598884,1686350.74365082 5402217.7661505))|LINESTRING(1684030.810025999788195 5402682.520687999203801,1684029.580235270550475 5402702.625448844395578)|false
+
 # Polygon|Triangle
 2|POLYGON((0 0,1 0,1 1,0 1,0 0),(0.4 0.4,0.4 0.6,0.6 0.6,0.6 0.4,0.4 0.4))|TRIANGLE((0 0,0.3 0,0.3 0.3,0 0))|true
 2|POLYGON((0 0,1 0,1 1,0 1,0 0),(0.4 0.4,0.4 0.6,0.6 0.6,0.6 0.4,0.4 0.4))|TRIANGLE((0 0,0.4 0,0.4 0.4,0 0))|true

@strk
Copy link
Author

strk commented Jun 17, 2015

Oops, sorry. Invalid ticket. The reported polygon does indeed cover the reported line.

@strk strk closed this as completed Jun 17, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant