[geos-commits] r2449 - in trunk/tests/xmltester: . tests/general

svn_geos at osgeo.org svn_geos at osgeo.org
Sat May 2 05:11:53 EDT 2009


Author: strk
Date: 2009-05-02 05:11:53 -0400 (Sat, 02 May 2009)
New Revision: 2449

Added:
   trunk/tests/xmltester/tests/general/TestRelateAA.xml
   trunk/tests/xmltester/tests/general/TestRelateAC.xml
   trunk/tests/xmltester/tests/general/TestRelateLA.xml
   trunk/tests/xmltester/tests/general/TestRelateLC.xml
   trunk/tests/xmltester/tests/general/TestRelateLL.xml
   trunk/tests/xmltester/tests/general/TestRelatePA.xml
   trunk/tests/xmltester/tests/general/TestRelatePL.xml
   trunk/tests/xmltester/tests/general/TestRelatePP.xml
Modified:
   trunk/tests/xmltester/Makefile.am
   trunk/tests/xmltester/XMLTester.cpp
Log:
Add support for testing 'contains' in XMLTester, add all Relate tests from JTS


Modified: trunk/tests/xmltester/Makefile.am
===================================================================
--- trunk/tests/xmltester/Makefile.am	2009-05-02 09:01:39 UTC (rev 2448)
+++ trunk/tests/xmltester/Makefile.am	2009-05-02 09:11:53 UTC (rev 2449)
@@ -23,6 +23,14 @@
 	$(srcdir)/tests/general/TestValid.xml \
 	$(srcdir)/tests/general/TestValid2.xml \
 	$(srcdir)/tests/general/TestValid2-big.xml \
+	$(srcdir)/tests/general/TestRelateAA.xml \
+	$(srcdir)/tests/general/TestRelateLA.xml \
+	$(srcdir)/tests/general/TestRelateLL.xml \
+	$(srcdir)/tests/general/TestRelatePL.xml \
+	$(srcdir)/tests/general/TestRelateAC.xml \
+	$(srcdir)/tests/general/TestRelateLC.xml \
+	$(srcdir)/tests/general/TestRelatePA.xml \
+	$(srcdir)/tests/general/TestRelatePP.xml \
 	$(srcdir)/tests/stmlf/stmlf-cases-20061020.xml \
 	$(srcdir)/tests/stmlf/stmlf-cases-20070119.xml \
 	$(srcdir)/tests/robust/TestRobustOverlayFixed.xml \

Modified: trunk/tests/xmltester/XMLTester.cpp
===================================================================
--- trunk/tests/xmltester/XMLTester.cpp	2009-05-02 09:01:39 UTC (rev 2448)
+++ trunk/tests/xmltester/XMLTester.cpp	2009-05-02 09:11:53 UTC (rev 2449)
@@ -620,6 +620,14 @@
 			if (actual_result==opRes) success=1;
 		}
 
+		else if (opName=="contains")
+		{
+			if (gA->contains(gB)) actual_result="true";
+			else actual_result="false";
+			
+			if (actual_result==opRes) success=1;
+		}
+
 		else if (opName=="getboundary")
 		{
 			geom::Geometry *gT=gA;

Added: trunk/tests/xmltester/tests/general/TestRelateAA.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelateAA.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelateAA.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,235 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>AA disjoint</desc>
+  <a>
+    POLYGON(
+      (0 0, 80 0, 80 80, 0 80, 0 0))
+  </a>
+  <b>
+    POLYGON(
+      (100 200, 100 140, 180 140, 180 200, 100 200))
+  </b>
+<test><op name="relate" arg3="FF2FF1212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   false   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA equal but opposite orientation</desc>
+  <a>
+    POLYGON(
+      (0 0, 140 0, 140 140, 0 140, 0 0))
+  </a>
+  <b>
+    POLYGON(
+      (140 0, 0 0, 0 140, 140 140, 140 0))
+  </b>
+<test>
+  <op name="relate" arg3="2FFF1FFF2" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   true   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell contains B-shell</desc>
+  <a>
+    POLYGON(
+      (40 60, 360 60, 360 300, 40 300, 40 60))
+  </a>
+  <b>
+    POLYGON(
+      (120 100, 280 100, 280 240, 120 240, 120 100))
+  </b>
+<test>
+  <op name="relate" arg3="212FF1FF2" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   true   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell contains B-shell contains A-hole</desc>
+  <a>
+    POLYGON(
+      (40 60, 420 60, 420 320, 40 320, 40 60), 
+      (200 140, 160 220, 260 200, 200 140))
+  </a>
+  <b>
+    POLYGON(
+      (80 100, 360 100, 360 280, 80 280, 80 100))
+  </b>
+<test>
+  <op name="relate" arg3="2121F12F2" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell contains B-shell contains A-hole contains B-hole</desc>
+  <a>
+    POLYGON(
+      (0 280, 0 0, 260 0, 260 280, 0 280), 
+      (220 240, 40 240, 40 40, 220 40, 220 240))
+  </a>
+  <b>
+    POLYGON(
+      (20 260, 240 260, 240 20, 20 20, 20 260), 
+      (160 180, 80 180, 120 120, 160 180))
+  </b>
+<test>
+  <op name="relate" arg3="2121F1212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell overlapping B-shell</desc>
+  <a>
+    POLYGON(
+      (60 80, 200 80, 200 220, 60 220, 60 80))
+  </a>
+  <b>
+    POLYGON(
+      (120 140, 260 140, 260 260, 120 260, 120 140))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">true</op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell overlapping B-shell at B-vertex</desc>
+  <a>
+    POLYGON(
+      (60 220, 220 220, 140 140, 60 220))
+  </a>
+  <b>
+    POLYGON(
+      (100 180, 180 180, 180 100, 100 100, 100 180))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell overlapping B-shell at A &amp; B-vertex</desc>
+  <a>
+    POLYGON(
+      (40 40, 180 40, 180 180, 40 180, 40 40))
+  </a>
+  <b>
+    POLYGON(
+      (180 40, 40 180, 160 280, 300 140, 180 40))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AmA A-shells overlapping B-shell at A-vertex</desc>
+  <a>
+    POLYGON(
+      (100 60, 140 100, 100 140, 60 100, 100 60))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (80 40, 120 40, 120 80, 80 80, 80 40)), 
+      (
+        (120 80, 160 80, 160 120, 120 120, 120 80)), 
+      (
+        (80 120, 120 120, 120 160, 80 160, 80 120)), 
+      (
+        (40 80, 80 80, 80 120, 40 120, 40 80)))
+  </b>
+<test>
+  <op name="relate" arg3="21210F212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA A-shell touches B-shell, which contains A-hole</desc>
+  <a>
+    POLYGON(
+      (40 280, 200 280, 200 100, 40 100, 40 280), 
+      (100 220, 120 220, 120 200, 100 180, 100 220))
+  </a>
+  <b>
+    POLYGON(
+      (40 280, 180 260, 180 120, 60 120, 40 280))
+  </b>
+<test>
+  <op name="relate" arg3="2121012F2" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA - A-hole contains B, boundaries touch in line</desc>
+  <a>
+    POLYGON(
+      (0 200, 0 0, 200 0, 200 200, 0 200), 
+      (20 180, 130 180, 130 30, 20 30, 20 180))
+  </a>
+  <b>
+    POLYGON(
+      (60 90, 130 90, 130 30, 60 30, 60 90))
+  </b>
+<test>
+  <op name="relate" arg3="FF2F11212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA - A-hole contains B, boundaries touch in points</desc>
+  <a>
+    POLYGON(
+      (150 150, 410 150, 280 20, 20 20, 150 150), 
+      (170 120, 330 120, 260 50, 100 50, 170 120))
+  </a>
+  <b>
+    POLYGON(
+      (270 90, 200 50, 150 80, 210 120, 270 90))
+  </b>
+<test>
+  <op name="relate" arg3="FF2F01212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+<case>
+  <desc>AA - A contained completely in B</desc>
+  <a>
+    POLYGON ((0 0, 20 80, 120 80, -20 120, 0 0))
+  </a>
+  <b>
+    POLYGON ((60 180, -100 120, -140 60, -40 20, -100 -80, 40 -20, 140 -100, 140 40, 260 160, 80 120, 60 180))
+  </b>
+<test>
+  <op name="relate" arg3="2FF1FF212" arg1="A" arg2="B"> true </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+<test>  <op name="contains" arg1="A" arg2="B">   false   </op></test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelateAC.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelateAC.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelateAC.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,27 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>AC A-shells overlapping B-shell at A-vertex</desc>
+  <a>
+    POLYGON(
+      (100 60, 140 100, 100 140, 60 100, 100 60))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (80 40, 120 40, 120 80, 80 80, 80 40)), 
+      (
+        (120 80, 160 80, 160 120, 120 120, 120 80)), 
+      (
+        (80 120, 120 120, 120 160, 80 160, 80 120)), 
+      (
+        (40 80, 80 80, 80 120, 40 120, 40 80)))
+  </b>
+<test>
+  <op name="relate" arg3="21210F212" arg1="A" arg2="B">    true  </op>
+</test>
+<test>  <op name="intersects" arg1="A" arg2="B">   true   </op></test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelateLA.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelateLA.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelateLA.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,190 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LA - intersection at NV: {A-Bdy, A-Int} = {B-Bdy, B-Int}</desc>
+  <a>
+    LINESTRING(100 120, 100 240)
+  </a>
+  <b>
+    POLYGON(
+      (40 60, 160 60, 160 180, 40 180, 40 60))
+  </b>
+<test>
+  <op name="relate" arg3="1010F0212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - intersection at V: {A-Bdy, A-Int} = {B-Bdy, B-Int}</desc>
+  <a>
+    LINESTRING(80 80, 140 140, 200 200)
+  </a>
+  <b>
+    POLYGON(
+      (40 40, 140 40, 140 140, 40 140, 40 40))
+  </b>
+<test>
+  <op name="relate" arg3="1010F0212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LmA - intersection at NV, L contained in A</desc>
+  <a>
+    LINESTRING(70 50, 70 150)
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (0 0, 0 100, 140 100, 140 0, 0 0)), 
+      (
+        (20 170, 70 100, 130 170, 20 170)))
+  </b>
+<test>
+  <op name="relate" arg3="10F0FF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - A crosses B at {shell-NV, hole-V}</desc>
+  <a>
+    LINESTRING(60 160, 150 70)
+  </a>
+  <b>
+    POLYGON(
+      (190 190, 360 20, 20 20, 190 190), 
+      (110 110, 250 100, 140 30, 110 110))
+  </b>
+<test>
+  <op name="relate" arg3="F01FF0212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - A intersects B at {shell-NV}, B-Int, {hole-V}</desc>
+  <a>
+    LINESTRING(60 160, 150 70)
+  </a>
+  <b>
+    POLYGON(
+      (190 190, 360 20, 20 20, 190 190), 
+      (111 110, 250 100, 140 30, 111 110))
+  </b>
+<test>
+  <op name="relate" arg3="101FF0212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - A crosses B hole at {hole1-V, hole2-NV}</desc>
+  <a>
+    LINESTRING(80 110, 170 110)
+  </a>
+  <b>
+    POLYGON(
+      (20 200, 20 20, 240 20, 240 200, 20 200), 
+      (130 110, 60 40, 60 180, 130 110), 
+      (130 180, 130 40, 200 110, 130 180))
+  </b>
+<test>
+  <op name="relate" arg3="F01FF0212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - A crosses B hole at {hole1-V}, B-Int, {hole2-NV}</desc>
+  <a>
+    LINESTRING(80 110, 170 110)
+  </a>
+  <b>
+    POLYGON(
+      (20 200, 20 20, 240 20, 240 200, 20 200), 
+      (130 110, 60 40, 60 180, 130 110), 
+      (130 180, 131 40, 200 110, 130 180))
+  </b>
+<test>
+  <op name="relate" arg3="101FF0212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+<desc>LA - Line with endpoints in interior but crossing exterior of multipolygon</desc>
+  <a>
+    LINESTRING(160 70, 320 230)
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (140 110, 260 110, 170 20, 50 20, 140 110)), 
+      (
+        (300 270, 420 270, 340 190, 220 190, 300 270)))
+  </b>
+  <test>
+    <op name="relate" arg1="A" arg2="B" arg3="1010FF212">true</op>
+  </test>
+</case>
+
+<case>
+<desc>LA - Line with a very small piece in the exterior between parts of a multipolygon</desc>
+  <a>
+    LINESTRING(100 140, 100 40)
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (20 80, 180 79, 100 0, 20 80)), 
+      (
+        (20 160, 180 160, 100 80, 20 160)))
+  </b>
+  <test>
+    <op name="relate" arg1="A" arg2="B" arg3="1010FF212">true</op>
+  </test>
+</case>
+
+<case>
+<desc>LA - Line contained completely and spanning parts of multipolygon</desc>
+  <a>
+    LINESTRING(100 140, 100 40)
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (20 80, 180 80, 100 0, 20 80)), 
+      (
+        (20 160, 180 160, 100 80, 20 160)))
+  </b>
+  <test>
+    <op name="relate" arg1="A" arg2="B" arg3="10F0FF212">true</op>
+  </test>
+</case>
+
+<case>
+<desc>LA - overlapping ring and triangle</desc>
+  <a>
+    LINESTRING(110 60, 20 150, 200 150, 110 60)
+  </a>
+  <b>
+    POLYGON(
+      (20 20, 200 20, 110 110, 20 20))
+  </b>
+  <test>
+    <op name="relate" arg1="A" arg2="B" arg3="101FFF212">true</op>
+  </test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelateLC.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelateLC.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelateLC.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,41 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LC - topographically equal with no boundary</desc>
+  <a>
+    LINESTRING(0 0, 0 50, 50 50, 50 0, 0 0)
+  </a>
+  <b>
+    MULTILINESTRING(
+      (0 0, 0 50), 
+      (0 50, 50 50), 
+      (50 50, 50 0), 
+      (50 0, 0 0))
+  </b>
+<test>
+  <op name="relate" arg3="1FFFFFFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LC - equal with boundary intersection</desc>
+  <a>
+    LINESTRING(0 0, 60 0, 60 60, 60 0, 120 0)
+  </a>
+  <b>
+    MULTILINESTRING(
+      (0 0, 60 0), 
+      (60 0, 120 0), 
+      (60 0, 60 60))
+  </b>
+<test>
+  <op name="relate" arg3="10FF0FFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelateLL.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelateLL.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelateLL.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,311 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LL - disjoint, non-overlapping envelopes</desc>
+  <a>
+    LINESTRING(60 0, 20 80, 100 80, 80 120, 40 140)
+  </a>
+  <b>
+    LINESTRING(140 300, 220 160, 260 200, 240 260)
+  </b>
+<test>
+  <op name="relate" arg3="FF1FF0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - disjoint, overlapping envelopes</desc>
+  <a>
+    LINESTRING(60 0, 20 80, 100 80, 80 120, 40 140)
+  </a>
+  <b>
+    LINESTRING(60 40, 140 40, 140 160, 0 160)
+  </b>
+<test>
+  <op name="relate" arg3="FF1FF0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - disjoint, non-overlapping envelopes, B closed</desc>
+  <a>
+    LINESTRING(60 0, 20 80, 100 80, 80 120, 40 140)
+  </a>
+  <b>
+    LINESTRING(140 280, 240 280, 240 180, 140 180, 140 280)
+  </b>
+<test>
+  <op name="relate" arg3="FF1FF01F2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - disjoint, overlapping envelopes, B closed</desc>
+  <a>
+    LINESTRING(140 0, 0 0, 40 60, 0 120, 60 200, 220 160, 220 40)
+  </a>
+  <b>
+    LINESTRING(80 140, 180 100, 160 40, 100 40, 60 100, 80 140)
+  </b>
+<test>
+  <op name="relate" arg3="FF1FF01F2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>Line vs line - pointwise equal</desc>
+  <a>
+    LINESTRING(20 20, 80 80)
+  </a>
+  <b>
+    LINESTRING(20 20, 80 80)
+  </b>
+<test>
+  <op name="relate" arg3="1FFF0FFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>Line vs line - pointwise equal</desc>
+  <a>
+    LINESTRING(40 40, 160 160, 200 60, 60 140)
+  </a>
+  <b>
+    LINESTRING(40 40, 160 160, 200 60, 60 140)
+  </b>
+<test>
+  <op name="relate" arg3="1FFF0FFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>Line vs line - topologically equal</desc>
+  <a>
+    LINESTRING(40 40, 200 40)
+  </a>
+  <b>
+    LINESTRING(200 40, 140 40, 40 40)
+  </b>
+<test>
+  <op name="relate" arg3="1FFF0FFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - topographically equal with self-intersection</desc>
+  <a>
+    LINESTRING(0 0, 110 0, 60 0)
+  </a>
+  <b>
+    LINESTRING(0 0, 110 0)
+  </b>
+<test>
+  <op name="relate" arg3="10F00FFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LmL - topographically equal with no boundary</desc>
+  <a>
+    LINESTRING(0 0, 0 50, 50 50, 50 0, 0 0)
+  </a>
+  <b>
+    MULTILINESTRING(
+      (0 0, 0 50), 
+      (0 50, 50 50), 
+      (50 50, 50 0), 
+      (50 0, 0 0))
+  </b>
+<test>
+  <op name="relate" arg3="1FFFFFFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LmL - topographically equal with self intersections</desc>
+  <a>
+    LINESTRING(0 0, 80 0, 80 60, 80 0, 170 0)
+  </a>
+  <b>
+    MULTILINESTRING(
+      (0 0, 170 0), 
+      (80 0, 80 60))
+  </b>
+<test>
+  <op name="relate" arg3="10FF0FFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A-IntNV = B-IntNV</desc>
+  <a>
+    LINESTRING(80 100, 180 200)
+  </a>
+  <b>
+    LINESTRING(80 180, 180 120)
+  </b>
+<test>
+  <op name="relate" arg3="0F1FF0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>intersect in Int NV</desc>
+  <a>
+    LINESTRING(40 40, 100 100, 160 160)
+  </a>
+  <b>
+    LINESTRING(160 60, 100 100, 60 140)
+  </b>
+<test>
+  <op name="relate" arg3="0F1FF0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - intersection: {A-Bdy, A-IntV} = B-IntNV</desc>
+  <a>
+    LINESTRING(40 40, 100 100, 180 100, 180 180, 100 180, 100 100)
+  </a>
+  <b>
+    LINESTRING(140 60, 60 140)
+  </b>
+<test>
+  <op name="relate" arg3="FF10F0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - intersection: {A-Bdy, A-IntNV} = B-IntNV</desc>
+  <a>
+    LINESTRING(40 40, 180 180, 100 180, 100 100)
+  </a>
+  <b>
+    LINESTRING(140 60, 60 140)
+  </b>
+<test>
+  <op name="relate" arg3="FF10F0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - intersection: A-IntNV = {B-Bdy, B-IntNV}</desc>
+  <a>
+    LINESTRING(20 110, 200 110)
+  </a>
+  <b>
+    LINESTRING(200 200, 20 20, 200 20, 110 110, 20 200, 110 200, 110 110)
+  </b>
+<test>
+  <op name="relate" arg3="F01FF0102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - one segment overlapping, one distinct</desc>
+  <a>
+    LINESTRING(80 90, 50 50, 0 0)
+  </a>
+  <b>
+    LINESTRING(0 0, 100 100)
+  </b>
+<test>
+  <op name="relate" arg3="1F1F00102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A contained in B</desc>
+  <a>
+    LINESTRING(40 140, 240 140)
+  </a>
+  <b>
+    LINESTRING(40 140, 100 140, 80 80, 120 60, 100 140, 160 140, 160 100, 200 100, 160 140, 
+    240 140)
+  </b>
+<test>
+  <op name="relate" arg3="1FFF0F1F2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - simple overlapping lines</desc>
+  <a>
+    LINESTRING(20 20, 100 20, 20 20)
+  </a>
+  <b>
+    LINESTRING(60 20, 200 20)
+  </b>
+<test>
+  <op name="relate" arg3="101FFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A-spiral, B-contained</desc>
+  <a>
+    LINESTRING(40 60, 180 60, 180 140, 100 140, 100 60, 220 60, 220 180, 80 180, 80 60, 
+    280 60)
+  </a>
+  <b>
+    LINESTRING(140 60, 180 60, 220 60, 260 60)
+  </b>
+<test>
+  <op name="relate" arg3="101FF0FF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+<desc>test for LinearRing point location bug</desc>
+  <a>
+    LINEARRING(0 0, 0 5, 5 5, 5 0, 0 0)
+  </a>
+  <b>
+    LINESTRING( 2 2, 4 4)
+  </b>
+  <test>
+    <op name="relate" arg1="A" arg2="B" arg3="FF1FFF102">true</op>
+  </test>
+</case>
+
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelatePA.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelatePA.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelatePA.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,103 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>PA - disjoint</desc>
+  <a>
+    POINT(20 20)
+  </a>
+  <b>
+    POLYGON(
+      (60 120, 60 40, 160 40, 160 120, 60 120))
+  </b>
+<test>
+  <op name="relate" arg3="FF0FFF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPA - points in B: E, I</desc>
+  <a>
+    MULTIPOINT((0 20), (40 20))
+  </a>
+  <b>
+    POLYGON(
+      (20 40, 20 0, 60 0, 60 40, 20 40))
+  </b>
+<test>
+  <op name="relate" arg3="0F0FFF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPA - points in B: E, B</desc>
+  <a>
+    MULTIPOINT((0 20), (20 20))
+  </a>
+  <b>
+    POLYGON(
+      (20 40, 20 0, 60 0, 60 40, 20 40))
+  </b>
+<test>
+  <op name="relate" arg3="F00FFF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPA - points in B: B, I</desc>
+  <a>
+    MULTIPOINT((20 20), (40 20))
+  </a>
+  <b>
+    POLYGON(
+      (20 40, 20 0, 60 0, 60 40, 20 40))
+  </b>
+<test>
+  <op name="relate" arg3="00FFFF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPA - points in B: I, B, E</desc>
+  <a>
+    MULTIPOINT((80 260), (140 260), (180 260))
+  </a>
+  <b>
+    POLYGON(
+      (40 320, 140 320, 140 200, 40 200, 40 320))
+  </b>
+<test>
+  <op name="relate" arg3="000FFF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PmA - point in B: mod-2 I</desc>
+  <a>
+    POINT(40 40)
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (0 40, 0 0, 40 0, 40 40, 0 40)), 
+      (
+        (40 80, 40 40, 80 40, 80 80, 40 80)))
+  </b>
+<test>
+  <op name="relate" arg3="F0FFFF212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelatePL.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelatePL.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelatePL.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,124 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>PL - disjoint</desc>
+  <a>
+    POINT(60 120)
+  </a>
+  <b>
+    LINESTRING(40 40, 120 120, 200 120)
+  </b>
+<test>
+  <op name="relate" arg3="FF0FFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PL - touches Bdy</desc>
+  <a>
+    POINT(40 40)
+  </a>
+  <b>
+    LINESTRING(40 40, 100 100, 160 100)
+  </b>
+<test>
+  <op name="relate" arg3="F0FFFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PL - touches non-vertex</desc>
+  <a>
+    POINT(60 60)
+  </a>
+  <b>
+    LINESTRING(40 40, 100 100)
+  </b>
+<test>
+  <op name="relate" arg3="0FFFFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPL - touches Bdy and Ext</desc>
+  <a>
+    MULTIPOINT((40 40), (100 40))
+  </a>
+  <b>
+    LINESTRING(40 40, 80 80)
+  </b>
+<test>
+  <op name="relate" arg3="F00FFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPL - touches Int and Bdy</desc>
+  <a>
+    MULTIPOINT((40 40), (60 60))
+  </a>
+  <b>
+    LINESTRING(40 40, 80 80)
+  </b>
+<test>
+  <op name="relate" arg3="00FFFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPL - touches Int and Ext</desc>
+  <a>
+    MULTIPOINT((60 60), (100 100))
+  </a>
+  <b>
+    LINESTRING(40 40, 80 80)
+  </b>
+<test>
+  <op name="relate" arg3="0F0FFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPL - touches IntNV and Ext</desc>
+  <a>
+    MULTIPOINT((60 60), (100 100))
+  </a>
+  <b>
+    LINESTRING(40 40, 80 80)
+  </b>
+<test>
+  <op name="relate" arg3="0F0FFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPL - touches IntV and Ext</desc>
+  <a>
+    MULTIPOINT((60 60), (100 100))
+  </a>
+  <b>
+    LINESTRING(40 40, 60 60, 80 80)
+  </b>
+<test>
+  <op name="relate" arg3="0F0FFF102" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestRelatePP.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestRelatePP.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestRelatePP.xml	2009-05-02 09:11:53 UTC (rev 2449)
@@ -0,0 +1,64 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>same point</desc>
+  <a>
+    POINT(20 20)
+  </a>
+  <b>
+    POINT(20 20)
+  </b>
+<test>
+  <op name="relate" arg3="0FFFFFFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>different point</desc>
+  <a>
+    POINT(20 20)
+  </a>
+  <b>
+    POINT(20 30)
+  </b>
+<test>
+  <op name="relate" arg3="FF0FFF0F2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>some same, some different points</desc>
+  <a>
+    MULTIPOINT((40 40), (80 60), (40 100))
+  </a>
+  <b>
+    MULTIPOINT((40 40), (80 60), (120 100))
+  </b>
+<test>
+  <op name="relate" arg3="0F0FFF0F2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>same points</desc>
+  <a>
+    MULTIPOINT((40 40), (80 60), (120 100))
+  </a>
+  <b>
+    MULTIPOINT((40 40), (80 60), (120 100))
+  </b>
+<test>
+  <op name="relate" arg3="0FFFFFFF2" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+</case>
+
+</run>



More information about the geos-commits mailing list