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

svn_geos at osgeo.org svn_geos at osgeo.org
Sat May 2 05:20:26 EDT 2009


Author: strk
Date: 2009-05-02 05:20:26 -0400 (Sat, 02 May 2009)
New Revision: 2452

Added:
   trunk/tests/xmltester/tests/general/TestFunctionAA.xml
   trunk/tests/xmltester/tests/general/TestFunctionAAPrec.xml
   trunk/tests/xmltester/tests/general/TestFunctionLA.xml
   trunk/tests/xmltester/tests/general/TestFunctionLAPrec.xml
   trunk/tests/xmltester/tests/general/TestFunctionLL.xml
   trunk/tests/xmltester/tests/general/TestFunctionLLPrec.xml
   trunk/tests/xmltester/tests/general/TestFunctionPA.xml
   trunk/tests/xmltester/tests/general/TestFunctionPL.xml
   trunk/tests/xmltester/tests/general/TestFunctionPLPrec.xml
   trunk/tests/xmltester/tests/general/TestFunctionPP.xml
Modified:
   trunk/tests/xmltester/Makefile.am
Log:
More tests from JTS (TestFunction*)


Modified: trunk/tests/xmltester/Makefile.am
===================================================================
--- trunk/tests/xmltester/Makefile.am	2009-05-02 09:17:23 UTC (rev 2451)
+++ trunk/tests/xmltester/Makefile.am	2009-05-02 09:20:26 UTC (rev 2452)
@@ -21,6 +21,16 @@
 	$(srcdir)/tests/general/TestCentroid.xml \
 	$(srcdir)/tests/general/TestConvexHull.xml \
 	$(srcdir)/tests/general/TestConvexHull-big.xml \
+	$(srcdir)/tests/general/TestFunctionAAPrec.xml \
+	$(srcdir)/tests/general/TestFunctionAA.xml \
+	$(srcdir)/tests/general/TestFunctionLAPrec.xml \
+	$(srcdir)/tests/general/TestFunctionLA.xml \
+	$(srcdir)/tests/general/TestFunctionLLPrec.xml \
+	$(srcdir)/tests/general/TestFunctionLL.xml \
+	$(srcdir)/tests/general/TestFunctionPA.xml \
+	$(srcdir)/tests/general/TestFunctionPLPrec.xml \
+	$(srcdir)/tests/general/TestFunctionPL.xml \
+	$(srcdir)/tests/general/TestFunctionPP.xml \
 	$(srcdir)/tests/general/TestInteriorPoint.xml \
 	$(srcdir)/tests/general/TestSimple.xml \
 	$(srcdir)/tests/general/TestValid.xml \

Added: trunk/tests/xmltester/tests/general/TestFunctionAA.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionAA.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionAA.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,633 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>AA - simple polygons</desc>
+  <a>
+    POLYGON(
+      (10 10, 100 10, 100 100, 10 100, 10 10))
+  </a>
+  <b>
+    POLYGON(
+      (50 50, 200 50, 200 200, 50 200, 50 50))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POLYGON(
+      (50 50, 50 100, 100 100, 100 50, 50 50))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (10 10, 10 100, 50 100, 50 200, 200 200, 200 50, 100 50, 100 10, 10 10))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (10 10, 10 100, 50 100, 50 50, 100 50, 100 10, 10 10))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 10, 10 100, 50 100, 50 50, 100 50, 100 10, 10 10)), 
+      (
+        (50 100, 50 200, 200 200, 200 50, 100 50, 100 100, 50 100)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - A with hole intersecting B</desc>
+  <a>
+    POLYGON(
+      (20 20, 20 160, 160 160, 160 20, 20 20), 
+      (140 140, 40 140, 40 40, 140 40, 140 140))
+  </a>
+  <b>
+    POLYGON(
+      (80 100, 220 100, 220 240, 80 240, 80 100))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POLYGON(
+      (80 140, 80 160, 160 160, 160 100, 140 100, 140 140, 80 140))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (20 20, 20 160, 80 160, 80 240, 220 240, 220 100, 160 100, 160 20, 20 20), 
+      (80 100, 80 140, 40 140, 40 40, 140 40, 140 100, 80 100))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (20 20, 20 160, 80 160, 80 140, 40 140, 40 40, 140 40, 140 100, 160 100, 
+      160 20, 20 20))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (20 20, 20 160, 80 160, 80 140, 40 140, 40 40, 140 40, 140 100, 160 100, 
+        160 20, 20 20)), 
+      (
+        (80 100, 80 140, 140 140, 140 100, 80 100)), 
+      (
+        (80 160, 80 240, 220 240, 220 100, 160 100, 160 160, 80 160)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - simple polygons #2</desc>
+  <a>
+    POLYGON(
+      (20 340, 330 380, 50 40, 20 340))
+  </a>
+  <b>
+    POLYGON(
+      (210 320, 140 270, 0 270, 140 220, 210 320))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POLYGON(
+      (27 270, 140 270, 210 320, 140 220, 28 260, 27 270))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (20 340, 330 380, 50 40, 28 260, 0 270, 27 270, 20 340))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (20 340, 330 380, 50 40, 28 260, 140 220, 210 320, 140 270, 27 270, 20 340))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (20 340, 330 380, 50 40, 28 260, 140 220, 210 320, 140 270, 27 270, 20 340)), 
+      (
+        (27 270, 28 260, 0 270, 27 270)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - simple polygons intersecting in P, L and A</desc>
+  <a>
+    POLYGON((0 0, 110 0, 110 60, 40 60, 180 140, 40 220, 110 260, 0 260, 0 0))
+  </a>
+  <b>
+    POLYGON((220 0, 110 0, 110 60, 180 60, 40 140, 180 220, 110 260, 220 260, 220 0))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(110 260), 
+      LINESTRING(110 0, 110 60), 
+      POLYGON(
+        (110 100, 40 140, 110 180, 180 140, 110 100)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (110 0, 0 0, 0 260, 110 260, 220 260, 220 0, 110 0), 
+      (110 260, 40 220, 110 180, 180 220, 110 260), 
+      (110 100, 40 60, 110 60, 180 60, 110 100))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (110 0, 0 0, 0 260, 110 260, 40 220, 110 180, 40 140, 110 100, 40 60, 
+      110 60, 110 0))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POLYGON(
+      (110 0, 0 0, 0 260, 110 260, 220 260, 220 0, 110 0), 
+      (110 260, 40 220, 110 180, 180 220, 110 260), 
+      (110 180, 40 140, 110 100, 180 140, 110 180), 
+      (110 100, 40 60, 110 60, 180 60, 110 100))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - simple polygons with two touching holes in their symDifference</desc>
+  <a>
+    POLYGON(
+      (0 0, 120 0, 120 50, 50 50, 120 100, 50 150, 120 150, 120 190, 0 190, 
+      0 0))
+  </a>
+  <b>
+    POLYGON(
+      (230 0, 120 0, 120 50, 190 50, 120 100, 190 150, 120 150, 120 190, 230 190, 
+      230 0))
+  </b>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POLYGON(
+      (120 0, 0 0, 0 190, 120 190, 230 190, 230 0, 120 0), 
+      (120 100, 50 50, 120 50, 190 50, 120 100), 
+      (120 100, 190 150, 120 150, 50 150, 120 100))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AmA - A simple, symDiff contains inversion</desc>
+  <a>
+    POLYGON(
+      (0 0, 210 0, 210 230, 0 230, 0 0))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (40 20, 0 0, 20 40, 60 60, 40 20)), 
+      (
+        (60 90, 60 60, 90 60, 90 90, 60 90)), 
+      (
+        (70 120, 90 90, 100 120, 70 120)), 
+      (
+        (120 70, 90 90, 120 100, 120 70)))
+  </b>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POLYGON(
+      (0 0, 0 230, 210 230, 210 0, 0 0), 
+      (0 0, 40 20, 60 60, 20 40, 0 0), 
+      (60 60, 90 60, 90 90, 60 90, 60 60), 
+      (90 90, 120 70, 120 100, 90 90), 
+      (90 90, 100 120, 70 120, 90 90))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AmA - A simple, B connected multiPolygon touching A at vertex</desc>
+  <a>
+    POLYGON(
+      (0 0, 340 0, 340 300, 0 300, 0 0))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (40 20, 0 0, 20 40, 60 60, 40 20)), 
+      (
+        (60 100, 60 60, 100 60, 100 100, 60 100)))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (40 20, 0 0, 20 40, 60 60, 40 20)), 
+      (
+        (60 60, 60 100, 100 100, 100 60, 60 60)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POLYGON(
+      (0 0, 0 300, 340 300, 340 0, 0 0), 
+      (0 0, 40 20, 60 60, 20 40, 0 0), 
+      (60 60, 100 60, 100 100, 60 100, 60 60))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AmA - A simple, B connected multiPolygon touching A at interior of edge</desc>
+  <a>
+    POLYGON(
+      (0 0, 120 0, 120 120, 0 120, 0 0))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (60 20, 0 20, 60 60, 60 20)), 
+      (
+        (60 100, 60 60, 100 60, 100 100, 60 100)))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (60 20, 0 20, 60 60, 60 20)), 
+      (
+        (60 60, 60 100, 100 100, 100 60, 60 60)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (0 20, 0 120, 120 120, 120 0, 0 0, 0 20))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (0 20, 0 120, 120 120, 120 0, 0 0, 0 20), 
+      (0 20, 60 20, 60 60, 0 20), 
+      (60 60, 100 60, 100 100, 60 100, 60 60))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POLYGON(
+      (0 20, 0 120, 120 120, 120 0, 0 0, 0 20), 
+      (0 20, 60 20, 60 60, 0 20), 
+      (60 60, 100 60, 100 100, 60 100, 60 60))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - simple polygons with holes</desc>
+  <a>
+    POLYGON(
+      (160 330, 60 260, 20 150, 60 40, 190 20, 270 130, 260 250, 160 330), 
+      (140 240, 80 190, 90 100, 160 70, 210 130, 210 210, 140 240))
+  </a>
+  <b>
+    POLYGON(
+      (300 330, 190 270, 150 170, 150 110, 250 30, 380 50, 380 250, 300 330), 
+      (290 240, 240 200, 240 110, 290 80, 330 170, 290 240))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POLYGON(
+      (251 104, 217 57, 176 89, 210 130, 210 210, 172 226, 190 270, 217 285, 260 250, 
+      263 218, 240 200, 240 110, 251 104))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (217 57, 190 20, 60 40, 20 150, 60 260, 160 330, 217 285, 190 270, 172 226, 
+        140 240, 80 190, 90 100, 160 70, 176 89, 217 57)), 
+      (
+        (217 57, 251 104, 290 80, 330 170, 290 240, 263 218, 260 250, 217 285, 300 330, 
+        380 250, 380 50, 250 30, 217 57)), 
+      (
+        (263 218, 270 130, 251 104, 240 110, 240 200, 263 218)), 
+      (
+        (172 226, 210 210, 210 130, 176 89, 150 110, 150 170, 172 226)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - simple polygons with hole touching shell</desc>
+  <a>
+    POLYGON ((20 0, 20 160, 200 160, 200 0, 20 0))
+  </a>
+  <b>
+    POLYGON ((220 80, 0 80, 0 240, 220 240, 220 80), 
+  	(100 80, 120 120, 80 120, 100 80))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POLYGON ((20 80, 20 160, 200 160, 200 80, 100 80, 20 80), 
+  (100 80, 120 120, 80 120, 100 80))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON ((20 0, 20 80, 0 80, 0 240, 220 240, 220 80, 200 80, 200 0, 20 0))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON (((20 0, 20 80, 100 80, 200 80, 200 0, 20 0)), 
+  ((100 80, 80 120, 120 120, 100 80)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON (((20 0, 20 80, 100 80, 200 80, 200 0, 20 0)), 
+  ((200 80, 200 160, 20 160, 20 80, 0 80, 0 240, 220 240, 220 80, 200 80)), 
+  ((100 80, 80 120, 120 120, 100 80)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mAmA - complex polygons touching and overlapping</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (120 340, 120 200, 140 200, 140 280, 160 280, 160 200, 180 200, 180 280, 200 280, 
+        200 200, 220 200, 220 340, 120 340)), 
+      (
+        (360 200, 220 200, 220 180, 300 180, 300 160, 220 160, 220 140, 300 140, 300 120, 
+        220 120, 220 100, 360 100, 360 200)))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (100 220, 100 200, 300 200, 300 220, 100 220)), 
+      (
+        (280 180, 280 160, 300 160, 300 180, 280 180)), 
+      (
+        (220 140, 220 120, 240 120, 240 140, 220 140)), 
+      (
+        (180 220, 160 240, 200 240, 180 220)))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTILINESTRING(
+      (120 340, 120 200, 140 200, 140 280, 160 280, 160 200, 180 200, 180 280, 200 280, 
+      200 200, 220 200, 220 340, 120 340), 
+      (360 200, 220 200, 220 180, 300 180, 300 160, 220 160, 220 140, 300 140, 300 120, 
+      220 120, 220 100, 360 100, 360 200))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (220 100, 120 200, 120 340, 220 340, 360 200, 360 100, 220 100))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(200 240), 
+      LINESTRING(300 200, 220 200), 
+      LINESTRING(280 180, 300 180), 
+      LINESTRING(300 180, 300 160), 
+      LINESTRING(300 160, 280 160), 
+      LINESTRING(220 140, 240 140), 
+      LINESTRING(240 120, 220 120), 
+      POLYGON(
+        (120 200, 120 220, 140 220, 140 200, 120 200)), 
+      POLYGON(
+        (160 200, 160 220, 180 220, 180 200, 160 200)), 
+      POLYGON(
+        (180 240, 180 220, 160 240, 180 240)), 
+      POLYGON(
+        (200 200, 200 220, 220 220, 220 200, 200 200)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (120 220, 120 340, 220 340, 220 220, 300 220, 300 200, 360 200, 360 100, 220 100, 
+      220 120, 220 140, 220 160, 280 160, 280 180, 220 180, 220 200, 200 200, 180 200, 160 200, 
+      140 200, 120 200, 100 200, 100 220, 120 220), 
+      (200 240, 200 280, 180 280, 180 240, 200 240), 
+      (200 240, 180 220, 200 220, 200 240), 
+      (160 240, 160 280, 140 280, 140 220, 160 220, 160 240), 
+      (240 120, 300 120, 300 140, 240 140, 240 120))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (120 220, 120 340, 220 340, 220 220, 200 220, 200 240, 200 280, 180 280, 180 240, 
+        160 240, 160 280, 140 280, 140 220, 120 220)), 
+      (
+        (160 220, 160 240, 180 220, 160 220)), 
+      (
+        (300 200, 360 200, 360 100, 220 100, 220 120, 240 120, 300 120, 300 140, 240 140, 
+        220 140, 220 160, 280 160, 300 160, 300 180, 280 180, 220 180, 220 200, 300 200)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (120 220, 120 340, 220 340, 220 220, 200 220, 200 240, 200 280, 180 280, 180 240, 
+        160 240, 160 280, 140 280, 140 220, 120 220)), 
+      (
+        (120 220, 120 200, 100 200, 100 220, 120 220)), 
+      (
+        (140 200, 140 220, 160 220, 160 200, 140 200)), 
+      (
+        (160 220, 160 240, 180 220, 160 220)), 
+      (
+        (180 200, 180 220, 200 220, 200 200, 180 200)), 
+      (
+        (180 220, 180 240, 200 240, 180 220)), 
+      (
+        (220 200, 220 220, 300 220, 300 200, 360 200, 360 100, 220 100, 220 120, 220 140, 
+        220 160, 280 160, 280 180, 220 180, 220 200), 
+        (240 120, 300 120, 300 140, 240 140, 240 120)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mAmA - complex polygons touching</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (100 200, 100 180, 120 180, 120 200, 100 200)), 
+      (
+        (60 240, 60 140, 220 140, 220 160, 160 160, 160 180, 200 180, 200 200, 160 200, 
+        160 220, 220 220, 220 240, 60 240), 
+        (80 220, 80 160, 140 160, 140 220, 80 220)), 
+      (
+        (280 220, 240 180, 260 160, 300 200, 280 220)))
+  </a>
+  <b>
+    MULTIPOLYGON(
+      (
+        (80 220, 80 160, 140 160, 140 220, 80 220), 
+        (100 200, 100 180, 120 180, 120 200, 100 200)), 
+      (
+        (220 240, 220 220, 160 220, 160 200, 220 200, 220 180, 160 180, 160 160, 220 160, 
+        220 140, 320 140, 320 240, 220 240), 
+        (240 220, 240 160, 300 160, 300 220, 240 220)))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTILINESTRING(
+      (100 200, 100 180, 120 180, 120 200, 100 200), 
+      (60 240, 60 140, 220 140, 220 160, 160 160, 160 180, 200 180, 200 200, 160 200, 
+      160 220, 220 220, 220 240, 60 240), 
+      (80 220, 80 160, 140 160, 140 220, 80 220), 
+      (280 220, 240 180, 260 160, 300 200, 280 220))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (60 140, 60 240, 220 240, 280 220, 300 200, 260 160, 220 140, 60 140))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(240 180), 
+      POINT(260 160), 
+      POINT(280 220), 
+      POINT(300 200), 
+      LINESTRING(100 200, 100 180), 
+      LINESTRING(100 180, 120 180), 
+      LINESTRING(120 180, 120 200), 
+      LINESTRING(120 200, 100 200), 
+      LINESTRING(220 140, 220 160), 
+      LINESTRING(220 160, 160 160), 
+      LINESTRING(160 160, 160 180), 
+      LINESTRING(160 180, 200 180), 
+      LINESTRING(200 200, 160 200), 
+      LINESTRING(160 200, 160 220), 
+      LINESTRING(160 220, 220 220), 
+      LINESTRING(220 220, 220 240), 
+      LINESTRING(80 220, 80 160), 
+      LINESTRING(80 160, 140 160), 
+      LINESTRING(140 160, 140 220), 
+      LINESTRING(140 220, 80 220))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (220 140, 60 140, 60 240, 220 240, 320 240, 320 140, 220 140), 
+        (200 200, 200 180, 220 180, 220 200, 200 200), 
+        (240 220, 240 180, 240 160, 260 160, 300 160, 300 200, 300 220, 280 220, 240 220)), 
+      (
+        (240 180, 280 220, 300 200, 260 160, 240 180)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (100 180, 100 200, 120 200, 120 180, 100 180)), 
+      (
+        (220 140, 60 140, 60 240, 220 240, 220 220, 160 220, 160 200, 200 200, 200 180, 
+        160 180, 160 160, 220 160, 220 140), 
+        (80 220, 80 160, 140 160, 140 220, 80 220)), 
+      (
+        (240 180, 280 220, 300 200, 260 160, 240 180)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (220 140, 60 140, 60 240, 220 240, 320 240, 320 140, 220 140), 
+        (200 200, 200 180, 220 180, 220 200, 200 200), 
+        (240 220, 240 180, 240 160, 260 160, 300 160, 300 200, 300 220, 280 220, 240 220)), 
+      (
+        (240 180, 280 220, 300 200, 260 160, 240 180)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - hole intersecting boundary to produce line</desc>
+  <a>
+    POLYGON(
+      (60 160, 140 160, 140 60, 60 60, 60 160))
+  </a>
+  <b>
+    POLYGON(
+      (160 160, 100 160, 100 100, 160 100, 160 160), 
+      (140 140, 120 140, 120 120, 140 120, 140 140))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    LINESTRING(60 160, 140 160, 140 60, 60 60, 60 160)
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (60 60, 60 160, 140 160, 140 60, 60 60))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(140 140, 140 120), 
+      POLYGON(
+        (100 160, 140 160, 140 140, 120 140, 120 120, 140 120, 140 100, 100 100, 100 160)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (60 160, 100 160, 140 160, 160 160, 160 100, 140 100, 140 60, 60 60, 60 160))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (60 160, 100 160, 100 100, 140 100, 140 60, 60 60, 60 160)), 
+      (
+        (140 140, 140 120, 120 120, 120 140, 140 140)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (60 160, 100 160, 100 100, 140 100, 140 60, 60 60, 60 160)), 
+      (
+        (140 140, 140 160, 160 160, 160 100, 140 100, 140 120, 120 120, 120 140, 140 140)))
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionAAPrec.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionAAPrec.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionAAPrec.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,828 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>AA - sliver triangle, cut by polygon</desc>
+  <a>
+    POLYGON(
+      (10 10, 100 10, 10 11, 10 10))
+  </a>
+  <b>
+    POLYGON(
+      (90 0, 200 0, 200 200, 90 200, 90 0))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(90 10, 100 10)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (90 10, 10 10, 10 11, 90 10)), 
+      (
+        (90 10, 90 200, 200 200, 200 0, 90 0, 90 10)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (90 10, 10 10, 10 11, 90 10))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (90 10, 10 10, 10 11, 90 10)), 
+      (
+        (90 10, 90 200, 200 200, 200 0, 90 0, 90 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - polygon with outward sliver, cut by polygon</desc>
+  <a>
+    POLYGON(
+      (100 10, 10 10, 90 11, 90 20, 100 20, 100 10))
+  </a>
+  <b>
+    POLYGON(
+      (20 20, 0 20, 0 0, 20 0, 20 20))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(20 10, 10 10)
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - narrow wedge in polygon</desc>
+  <a>
+    POLYGON((10 10, 50 10, 50 50, 10 50, 10 31, 49 30, 10 30, 10 10))
+  </a>
+  <b>
+    POLYGON((60 40, 40 40, 40 20, 60 20, 60 40))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POLYGON(
+      (50 40, 50 20, 40 20, 40 30, 40 40, 50 40))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (50 20, 50 10, 10 10, 10 30, 40 30, 10 31, 10 50, 50 50, 50 40, 
+      60 40, 60 20, 50 20))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (50 20, 50 10, 10 10, 10 30, 40 30, 40 20, 50 20)), 
+      (
+        (40 30, 10 31, 10 50, 50 50, 50 40, 40 40, 40 30)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (50 20, 50 10, 10 10, 10 30, 40 30, 40 20, 50 20)), 
+      (
+        (50 20, 50 40, 60 40, 60 20, 50 20)), 
+      (
+        (40 30, 10 31, 10 50, 50 50, 50 40, 40 40, 40 30)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - hole close to shell</desc>
+  <a>
+    POLYGON(
+      (10 100, 10 10, 100 10, 100 100, 10 100), 
+      (90 90, 11 90, 10 10, 90 11, 90 90))
+  </a>
+  <b>
+    POLYGON(
+      (0 30, 0 0, 30 0, 30 30, 0 30))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (10 30, 10 10), 
+      (10 10, 30 10))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (30 10, 30 0, 0 0, 0 30, 10 30, 30 30, 30 10)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (30 10, 30 0, 0 0, 0 30, 10 30, 30 30, 30 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mAA - shells close together</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (0 0, 100 0, 100 20, 0 20, 0 0)), 
+      (
+        (0 40, 0 21, 100 20, 100 40, 0 40)))
+  </a>
+  <b>
+    POLYGON(
+      (110 30, 90 30, 90 10, 110 10, 110 30))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(100 20, 90 20), 
+      POLYGON(
+        (100 20, 100 10, 90 10, 90 20, 90 30, 100 30, 100 20)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (100 10, 100 0, 0 0, 0 20, 90 20, 0 21, 0 40, 100 40, 100 30, 
+      110 30, 110 10, 100 10))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (100 10, 100 0, 0 0, 0 20, 90 20, 90 10, 100 10)), 
+      (
+        (90 20, 0 21, 0 40, 100 40, 100 30, 90 30, 90 20)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (100 10, 100 0, 0 0, 0 20, 90 20, 90 10, 100 10)), 
+      (
+        (100 10, 100 20, 100 30, 110 30, 110 10, 100 10)), 
+      (
+        (90 20, 0 21, 0 40, 100 40, 100 30, 90 30, 90 20)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - A sliver triangle cutting all the way across B</desc>
+  <a>
+    POLYGON(
+      (100 10, 0 10, 100 11, 100 10))
+  </a>
+  <b>
+    POLYGON(
+      (20 20, 0 20, 0 0, 20 0, 20 20))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(20 10, 0 10)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (100 10, 20 10, 100 11, 100 10)), 
+      (
+        (0 10, 0 20, 20 20, 20 10, 20 0, 0 0, 0 10)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (100 10, 20 10, 100 11, 100 10))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (100 10, 20 10, 100 11, 100 10)), 
+      (
+        (0 10, 0 20, 20 20, 20 10, 20 0, 0 0, 0 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - A polygon with sliver cutting all the way across B</desc>
+  <a>
+    POLYGON(
+      (100 10, 0 10, 90 11, 90 20, 100 20, 100 10))
+  </a>
+  <b>
+    POLYGON(
+      (20 20, 0 20, 0 0, 20 0, 20 20))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(20 10, 0 10)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (100 10, 20 10, 90 11, 90 20, 100 20, 100 10)), 
+      (
+        (0 10, 0 20, 20 20, 20 10, 20 0, 0 0, 0 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - hole close to shell, B coincident with A</desc>
+  <a>
+    POLYGON(
+      (10 100, 10 10, 100 10, 100 100, 10 100), 
+      (90 90, 11 90, 10 10, 90 11, 90 90))
+  </a>
+  <b>
+    POLYGON(
+      (10 30, 10 0, 30 10, 30 30, 10 30))
+  </b>
+<test>
+  <op name="relate" arg3="212111212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (10 30, 10 10), 
+      (10 10, 30 10))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (10 10, 10 30, 30 30, 30 10, 10 0, 10 10)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (10 10, 10 30, 30 30, 30 10, 10 0, 10 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - A hole close to shell, B coincident with A</desc>
+  <a>
+    POLYGON(
+      (10 100, 10 10, 100 10, 100 100, 10 100), 
+      (90 90, 11 90, 10 10, 90 11, 90 90))
+  </a>
+  <b>
+    POLYGON(
+      (10 30, 10 10, 30 10, 30 30, 10 30))
+  </b>
+<test>
+  <op name="relate" arg3="212111212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (10 30, 10 10), 
+      (10 10, 30 10))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (10 10, 10 30, 30 30, 30 10, 10 10)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (10 10, 10 30, 30 30, 30 10, 10 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - B hole close to shell, A coincident with B</desc>
+  <a>
+    POLYGON(
+      (10 30, 10 10, 30 10, 30 30, 10 30))
+  </a>
+  <b>
+    POLYGON(
+      (10 100, 10 10, 100 10, 100 100, 10 100), 
+      (90 90, 11 90, 10 10, 90 11, 90 90))
+  </b>
+<test>
+  <op name="relate" arg3="212111212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (10 30, 10 10), 
+      (10 10, 30 10))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (10 10, 10 30, 30 30, 30 10, 10 10)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (10 10, 10 30, 30 30, 30 10, 10 10))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (10 30, 10 100, 100 100, 100 10, 30 10, 90 11, 90 90, 11 90, 10 30)), 
+      (
+        (10 10, 10 30, 30 30, 30 10, 10 10)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - B sliver crossing A triangle in line segment with length &lt; 1</desc>
+  <a>
+    POLYGON(
+      (0 0, 200 0, 0 198, 0 0))
+  </a>
+  <b>
+    POLYGON(
+      (280 60, 139 60, 280 70, 280 60))
+  </b>
+<test>
+  <op name="relate" arg3="212101212" arg1="A" arg2="B">
+    true
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(139 60)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (139 60, 200 0, 0 0, 0 198, 139 60)), 
+      (
+        (280 60, 139 60, 280 70, 280 60)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (139 60, 200 0, 0 0, 0 198, 139 60))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (139 60, 200 0, 0 0, 0 198, 139 60)), 
+      (
+        (280 60, 139 60, 280 70, 280 60)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - sliver triangles, at angle to each other</desc>
+  <a>
+    POLYGON(
+      (0 0, 140 10, 0 20, 0 0))
+  </a>
+  <b>
+    POLYGON(
+      (280 0, 139 10, 280 1, 280 0))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(140 10, 139 10)
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - sliver triangle with multiple intersecting boxes</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (1 4, 1 1, 2 1, 2 4, 1 4)), 
+      (
+        (3 4, 3 1, 4 1, 4 4, 3 4)), 
+      (
+        (5 4, 5 1, 6 1, 6 4, 5 4)), 
+      (
+        (7 4, 7 1, 8 1, 8 4, 7 4)), 
+      (
+        (9 4, 9 1, 10 1, 10 4, 9 4)))
+  </a>
+  <b>
+    POLYGON(
+      (0 2, 11 3, 11 2, 0 2))
+  </b>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (1 1, 1 4, 10 4, 10 1, 1 1))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(1 2, 2 2), 
+      LINESTRING(3 2, 4 2), 
+      POLYGON(
+        (6 3, 6 2, 5 2, 6 3)), 
+      POLYGON(
+        (7 2, 7 3, 8 3, 8 2, 7 2)), 
+      POLYGON(
+        (9 2, 9 3, 10 3, 10 2, 9 2)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+GEOMETRYCOLLECTION(
+  LINESTRING(0 2, 1 2), 
+  LINESTRING(2 2, 3 2), 
+  LINESTRING(4 2, 5 2), 
+  POLYGON(
+    (1 2, 1 4, 2 4, 2 2, 2 1, 1 1, 1 2)), 
+  POLYGON(
+    (3 2, 3 4, 4 4, 4 2, 4 1, 3 1, 3 2)), 
+  POLYGON(
+    (5 2, 5 4, 6 4, 6 3, 7 3, 7 4, 8 4, 8 3, 9 3, 
+    9 4, 10 4, 10 3, 11 3, 11 2, 10 2, 10 1, 9 1, 9 2, 8 2, 
+    8 1, 7 1, 7 2, 6 2, 6 1, 5 1, 5 2)))  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (1 2, 1 4, 2 4, 2 2, 2 1, 1 1, 1 2)), 
+      (
+        (3 2, 3 4, 4 4, 4 2, 4 1, 3 1, 3 2)), 
+      (
+        (5 2, 5 4, 6 4, 6 3, 5 2)), 
+      (
+        (6 2, 6 1, 5 1, 5 2, 6 2)), 
+      (
+        (7 3, 7 4, 8 4, 8 3, 7 3)), 
+      (
+        (8 2, 8 1, 7 1, 7 2, 8 2)), 
+      (
+        (9 3, 9 4, 10 4, 10 3, 9 3)), 
+      (
+        (10 2, 10 1, 9 1, 9 2, 10 2)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+GEOMETRYCOLLECTION(
+  LINESTRING(0 2, 1 2), 
+  LINESTRING(2 2, 3 2), 
+  LINESTRING(4 2, 5 2), 
+  POLYGON(
+    (1 2, 1 4, 2 4, 2 2, 2 1, 1 1, 1 2)), 
+  POLYGON(
+    (3 2, 3 4, 4 4, 4 2, 4 1, 3 1, 3 2)), 
+  POLYGON(
+    (5 2, 5 4, 6 4, 6 3, 5 2)), 
+  POLYGON(
+    (6 2, 6 1, 5 1, 5 2, 6 2)), 
+  POLYGON(
+    (6 2, 6 3, 7 3, 7 2, 6 2)), 
+  POLYGON(
+    (7 3, 7 4, 8 4, 8 3, 7 3)), 
+  POLYGON(
+    (8 2, 8 1, 7 1, 7 2, 8 2)), 
+  POLYGON(
+    (8 2, 8 3, 9 3, 9 2, 8 2)), 
+  POLYGON(
+    (9 3, 9 4, 10 4, 10 3, 9 3)), 
+  POLYGON(
+    (10 2, 10 1, 9 1, 9 2, 10 2)), 
+  POLYGON(
+    (10 2, 10 3, 11 3, 11 2, 10 2)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - Polygon with hole with outward sliver, cut by polygon</desc>
+  <a>
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 40, 20 40), 
+      (180 120, 120 120, 120 160, 60 120, 120 80, 120 119, 180 120))
+  </a>
+  <b>
+    POLYGON(
+      (200 160, 160 160, 160 80, 200 80, 200 160))
+  </b>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 40, 20 40))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(180 120, 160 120), 
+      POLYGON(
+        (180 160, 180 120, 180 80, 160 80, 160 120, 160 160, 180 160)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 160, 200 160, 200 80, 180 80, 180 40, 20 40), 
+      (160 120, 120 120, 120 160, 60 120, 120 80, 120 119, 160 120))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 160, 160 160, 160 120, 160 80, 180 80, 180 40, 
+      20 40), 
+      (160 120, 120 120, 120 160, 60 120, 120 80, 120 119, 160 120))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (20 40, 20 200, 180 200, 180 160, 160 160, 160 120, 160 80, 180 80, 180 40, 
+        20 40), 
+        (160 120, 120 120, 120 160, 60 120, 120 80, 120 119, 160 120)), 
+      (
+        (180 120, 180 160, 200 160, 200 80, 180 80, 180 120)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - Polygon with hole with outward sliver, cut by line</desc>
+  <a>
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 40, 20 40), 
+      (180 120, 120 120, 120 160, 60 120, 120 80, 120 119, 180 120))
+  </a>
+  <b>
+    LINESTRING(160 140, 160 100)
+  </b>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 40, 20 40))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (160 140, 160 120), 
+      (160 120, 160 100))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 120, 180 40, 20 40), 
+      (160 120, 120 120, 120 160, 60 120, 120 80, 120 119, 160 120))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 120, 180 40, 20 40), 
+      (160 120, 120 120, 120 160, 60 120, 120 80, 120 119, 160 120))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 120, 180 40, 20 40), 
+      (160 120, 120 120, 120 160, 60 120, 120 80, 120 119, 160 120))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - Polygon with inward sliver touching hole, cut by polygon</desc>
+  <a>
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 120, 140 120, 180 119, 180 40, 20 40), 
+      (140 160, 80 120, 140 80, 140 160))
+  </a>
+  <b>
+    POLYGON(
+      (200 160, 150 160, 150 80, 200 80, 200 160))
+  </b>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 40, 20 40))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (180 160, 180 120, 150 120, 150 160, 180 160)), 
+      (
+        (150 120, 180 119, 180 80, 150 80, 150 120)))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 160, 200 160, 200 80, 180 80, 180 40, 20 40), 
+      (140 160, 80 120, 140 80, 140 120, 140 160))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POLYGON(
+      (20 40, 20 200, 180 200, 180 160, 150 160, 150 120, 150 80, 180 80, 180 40, 
+      20 40), 
+      (140 160, 80 120, 140 80, 140 120, 140 160))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (20 40, 20 200, 180 200, 180 160, 150 160, 150 120, 150 80, 180 80, 180 40, 
+        20 40), 
+        (140 160, 80 120, 140 80, 140 120, 140 160)), 
+      (
+        (150 120, 180 120, 180 160, 200 160, 200 80, 180 80, 180 119, 150 120)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>AA - intersecting slivers, dimensional collapse</desc>
+  <a>
+    POLYGON(
+      (83 33, 62 402, 68 402, 83 33))
+  </a>
+  <b>
+    POLYGON(
+      (78 39, 574 76, 576 60, 78 39))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    LINESTRING(83 33, 62 402, 68 402, 83 33)
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (83 33, 62 402, 68 402, 83 33))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(83 39)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(78 39, 83 39), 
+      LINESTRING(83 33, 83 39), 
+      POLYGON(
+        (83 39, 62 402, 68 402, 83 39)), 
+      POLYGON(
+        (83 39, 574 76, 576 60, 83 39)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(83 33, 83 39), 
+      POLYGON(
+        (83 39, 62 402, 68 402, 83 39)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(78 39, 83 39), 
+      LINESTRING(83 33, 83 39), 
+      POLYGON(
+        (83 39, 62 402, 68 402, 83 39)), 
+      POLYGON(
+        (83 39, 574 76, 576 60, 83 39)))
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionLA.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionLA.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionLA.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,522 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LA - A and B simple</desc>
+  <a>
+    LINESTRING(240 190, 120 120)
+  </a>
+  <b>
+    POLYGON(
+      (110 240, 50 80, 240 70, 110 240))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(177 153, 120 120)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(240 190, 177 153), 
+      POLYGON(
+        (177 153, 240 70, 50 80, 110 240, 177 153)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    LINESTRING(240 190, 177 153)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(240 190, 177 153), 
+      POLYGON(
+        (177 153, 240 70, 50 80, 110 240, 177 153)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - A intersects B-hole</desc>
+  <a>
+    LINESTRING(0 100, 100 100, 200 200)
+  </a>
+  <b>
+    POLYGON(
+      (30 240, 260 30, 30 30, 30 240), 
+      (80 140, 80 80, 140 80, 80 140))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (30 100, 80 100), 
+      (110 110, 140 140))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(0 100, 30 100), 
+      LINESTRING(80 100, 100 100, 110 110), 
+      LINESTRING(140 140, 200 200), 
+      POLYGON(
+        (30 240, 140 140, 260 30, 30 30, 30 100, 30 240), 
+        (80 140, 80 100, 80 80, 140 80, 110 110, 80 140)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (0 100, 30 100), 
+      (80 100, 100 100, 110 110), 
+      (140 140, 200 200))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(0 100, 30 100), 
+      LINESTRING(80 100, 100 100, 110 110), 
+      LINESTRING(140 140, 200 200), 
+      POLYGON(
+        (30 240, 140 140, 260 30, 30 30, 30 100, 30 240), 
+        (80 140, 80 100, 80 80, 140 80, 110 110, 80 140)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LA - A intersects B-hole #2</desc>
+  <a>
+    LINESTRING(40 340, 200 250, 120 180, 160 110, 270 40)
+  </a>
+  <b>
+    POLYGON(
+      (160 330, 60 260, 20 150, 60 40, 190 20, 270 130, 260 250, 160 330), 
+      (140 240, 80 190, 90 100, 160 70, 210 130, 210 210, 140 240))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (114 298, 200 250, 173 226), 
+      (182 96, 225 68))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(40 340, 114 298), 
+      LINESTRING(173 226, 120 180, 160 110, 182 96), 
+      LINESTRING(225 68, 270 40), 
+      POLYGON(
+        (114 298, 160 330, 260 250, 270 130, 225 68, 190 20, 60 40, 20 150, 60 260, 
+        114 298), 
+        (140 240, 80 190, 90 100, 160 70, 182 96, 210 130, 210 210, 173 226, 140 240)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (40 340, 114 298), 
+      (173 226, 120 180, 160 110, 182 96), 
+      (225 68, 270 40))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(40 340, 114 298), 
+      LINESTRING(173 226, 120 180, 160 110, 182 96), 
+      LINESTRING(225 68, 270 40), 
+      POLYGON(
+        (114 298, 160 330, 260 250, 270 130, 225 68, 190 20, 60 40, 20 150, 60 260, 
+        114 298), 
+        (140 240, 80 190, 90 100, 160 70, 182 96, 210 130, 210 210, 173 226, 140 240)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mLmA - A and B complex, disjoint</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (60 320, 60 80, 300 80, 60 320), 
+        (80 280, 80 100, 260 100, 80 280)), 
+      (
+        (120 160, 140 160, 140 140, 120 160)))
+  </a>
+  <b>
+    MULTILINESTRING(
+      (100 240, 100 180, 160 180, 160 120, 220 120), 
+      (40 360, 40 60, 340 60, 40 360, 40 20), 
+      (120 120, 120 140, 100 140, 100 120, 140 120))
+  </b>
+<test>
+  <op name="convexhull" pattern="FFFFFFFFF" arg1="A">
+    POLYGON(
+      (60 80, 60 320, 300 80, 60 80))
+  </op>
+</test>
+<test>
+  <op name="getboundary" pattern="FFFFFFFFF" arg1="A">
+    MULTILINESTRING(
+      (60 320, 60 80, 300 80, 60 320), 
+      (80 280, 80 100, 260 100, 80 280), 
+      (120 160, 140 160, 140 140, 120 160))
+  </op>
+</test>
+<test>
+  <op name="symdifference" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(100 240, 100 180, 160 180, 160 120, 220 120), 
+      LINESTRING(40 360, 40 60), 
+      LINESTRING(40 60, 340 60, 40 360), 
+      LINESTRING(40 60, 40 20), 
+      LINESTRING(120 120, 120 140, 100 140, 100 120, 120 120), 
+      LINESTRING(120 120, 140 120), 
+      POLYGON(
+        (60 320, 300 80, 60 80, 60 320), 
+        (80 280, 80 100, 260 100, 80 280)), 
+      POLYGON(
+        (120 160, 140 160, 140 140, 120 160)))
+  </op>
+</test>
+<test>
+  <op name="difference" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (60 320, 300 80, 60 80, 60 320), 
+        (80 280, 80 100, 260 100, 80 280)), 
+      (
+        (120 160, 140 160, 140 140, 120 160)))
+  </op>
+</test>
+<test>
+  <op name="union" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(100 240, 100 180, 160 180, 160 120, 220 120), 
+      LINESTRING(40 360, 40 60), 
+      LINESTRING(40 60, 340 60, 40 360), 
+      LINESTRING(40 60, 40 20), 
+      LINESTRING(120 120, 120 140, 100 140, 100 120, 120 120), 
+      LINESTRING(120 120, 140 120), 
+      POLYGON(
+        (60 320, 300 80, 60 80, 60 320), 
+        (80 280, 80 100, 260 100, 80 280)), 
+      POLYGON(
+        (120 160, 140 160, 140 140, 120 160)))
+  </op>
+</test>
+<test>
+  <op name="intersection" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mLmA - A and B complex, overlapping and touching #1</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (60 260, 60 120, 220 120, 220 260, 60 260), 
+        (80 240, 80 140, 200 140, 200 240, 80 240)), 
+      (
+        (100 220, 100 160, 180 160, 180 220, 100 220), 
+        (120 200, 120 180, 160 180, 160 200, 120 200)))
+  </a>
+  <b>
+    MULTILINESTRING(
+      (40 260, 240 260, 240 240, 40 240, 40 220, 240 220), 
+      (120 300, 120 80, 140 80, 140 300, 140 80, 120 80, 120 320))
+  </b>
+  <test>
+    <op name="getboundary" arg1="A">
+      MULTILINESTRING(
+        (60 260, 60 120, 220 120, 220 260, 60 260), 
+        (80 240, 80 140, 200 140, 200 240, 80 240), 
+        (100 220, 100 160, 180 160, 180 220, 100 220), 
+        (120 200, 120 180, 160 180, 160 200, 120 200))
+          </op>
+  </test>
+  <test>
+    <op name="convexhull" arg1="A">
+      POLYGON(
+        (60 120, 60 260, 220 260, 220 120, 60 120))
+          </op>
+  </test>
+  <test>
+    <op name="intersection" arg1="A" arg2="B">
+      MULTILINESTRING(
+        (220 260, 140 260), 
+        (140 260, 120 260), 
+        (120 260, 60 260), 
+        (200 240, 140 240), 
+        (140 240, 120 240), 
+        (120 240, 80 240), 
+        (180 220, 140 220), 
+        (140 220, 120 220), 
+        (120 220, 100 220), 
+        (120 200, 120 180), 
+        (220 240, 200 240), 
+        (80 240, 60 240), 
+        (60 220, 80 220), 
+        (200 220, 220 220), 
+        (120 260, 120 240), 
+        (120 220, 120 200), 
+        (120 180, 120 160), 
+        (120 140, 120 120), 
+        (140 120, 140 140), 
+        (140 160, 140 180), 
+        (140 200, 140 220), 
+        (140 240, 140 260))
+          </op>
+  </test>
+  <test>
+    <op name="union" arg1="A" arg2="B">
+      GEOMETRYCOLLECTION(
+        LINESTRING(40 260, 60 260), 
+        LINESTRING(220 260, 240 260, 240 240, 220 240), 
+        LINESTRING(60 240, 40 240, 40 220, 60 220), 
+        LINESTRING(80 220, 100 220), 
+        LINESTRING(180 220, 200 220), 
+        LINESTRING(220 220, 240 220), 
+        LINESTRING(120 300, 120 260), 
+        LINESTRING(120 240, 120 220), 
+        LINESTRING(120 160, 120 140), 
+        LINESTRING(120 120, 120 80), 
+        LINESTRING(120 80, 140 80), 
+        LINESTRING(140 80, 140 120), 
+        LINESTRING(140 140, 140 160), 
+        LINESTRING(140 180, 140 200), 
+        LINESTRING(140 220, 140 240), 
+        LINESTRING(140 260, 140 300), 
+        LINESTRING(120 300, 120 320), 
+        POLYGON(
+          (60 240, 60 260, 120 260, 140 260, 220 260, 220 240, 220 220, 220 120, 140 120, 
+          120 120, 60 120, 60 220, 60 240), 
+          (80 240, 80 220, 80 140, 120 140, 140 140, 200 140, 200 220, 200 240, 140 240, 
+          120 240, 80 240)), 
+        POLYGON(
+          (120 160, 100 160, 100 220, 120 220, 140 220, 180 220, 180 160, 140 160, 120 160), 
+          (120 200, 120 180, 140 180, 160 180, 160 200, 140 200, 120 200)))
+          </op>
+  </test>
+  <test>
+    <op name="difference" arg1="A" arg2="B">
+      MULTIPOLYGON(
+        (
+          (60 240, 60 260, 120 260, 140 260, 220 260, 220 240, 220 220, 220 120, 140 120, 
+          120 120, 60 120, 60 220, 60 240), 
+          (80 240, 80 220, 80 140, 120 140, 140 140, 200 140, 200 220, 200 240, 140 240, 
+          120 240, 80 240)), 
+        (
+          (120 160, 100 160, 100 220, 120 220, 140 220, 180 220, 180 160, 140 160, 120 160), 
+          (120 200, 120 180, 140 180, 160 180, 160 200, 140 200, 120 200)))
+          </op>
+  </test>
+  <test>
+    <op name="symdifference" arg1="A" arg2="B">
+      GEOMETRYCOLLECTION(
+        LINESTRING(40 260, 60 260), 
+        LINESTRING(220 260, 240 260, 240 240, 220 240), 
+        LINESTRING(60 240, 40 240, 40 220, 60 220), 
+        LINESTRING(80 220, 100 220), 
+        LINESTRING(180 220, 200 220), 
+        LINESTRING(220 220, 240 220), 
+        LINESTRING(120 300, 120 260), 
+        LINESTRING(120 240, 120 220), 
+        LINESTRING(120 160, 120 140), 
+        LINESTRING(120 120, 120 80), 
+        LINESTRING(120 80, 140 80), 
+        LINESTRING(140 80, 140 120), 
+        LINESTRING(140 140, 140 160), 
+        LINESTRING(140 180, 140 200), 
+        LINESTRING(140 220, 140 240), 
+        LINESTRING(140 260, 140 300), 
+        LINESTRING(120 300, 120 320), 
+        POLYGON(
+          (60 240, 60 260, 120 260, 140 260, 220 260, 220 240, 220 220, 220 120, 140 120, 
+          120 120, 60 120, 60 220, 60 240), 
+          (80 240, 80 220, 80 140, 120 140, 140 140, 200 140, 200 220, 200 240, 140 240, 
+          120 240, 80 240)), 
+        POLYGON(
+          (120 160, 100 160, 100 220, 120 220, 140 220, 180 220, 180 160, 140 160, 120 160), 
+          (120 200, 120 180, 140 180, 160 180, 160 200, 140 200, 120 200)))
+          </op>
+  </test>
+</case><case>
+  <desc>mLmA - A and B complex, overlapping and touching #2</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (60 320, 60 120, 280 120, 280 320, 60 320), 
+        (120 260, 120 180, 240 180, 240 260, 120 260)), 
+      (
+        (280 400, 320 400, 320 360, 280 360, 280 400)), 
+      (
+        (300 240, 300 220, 320 220, 320 240, 300 240)))
+  </a>
+  <b>
+    MULTILINESTRING(
+      (80 300, 80 160, 260 160, 260 300, 80 300, 80 140), 
+      (220 360, 220 240, 300 240, 300 360))
+  </b>
+<test>
+  <op name="convexhull" pattern="FFFFFFFFF" arg1="A">
+    POLYGON(
+      (60 120, 60 320, 280 400, 320 400, 320 220, 280 120, 60 120))
+  </op>
+</test>
+<test>
+  <op name="getboundary" pattern="FFFFFFFFF" arg1="A">
+    MULTILINESTRING(
+      (60 320, 60 120, 280 120, 280 320, 60 320), 
+      (120 260, 120 180, 240 180, 240 260, 120 260), 
+      (280 400, 320 400, 320 360, 280 360, 280 400), 
+      (300 240, 300 220, 320 220, 320 240, 300 240))
+  </op>
+</test>
+<test>
+  <op name="symdifference" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(220 360, 220 320), 
+      LINESTRING(220 260, 220 240, 240 240), 
+      LINESTRING(280 240, 300 240), 
+      LINESTRING(300 240, 300 360), 
+      POLYGON(
+        (280 240, 280 120, 60 120, 60 320, 220 320, 280 320, 280 240), 
+        (120 260, 120 180, 240 180, 240 240, 240 260, 220 260, 120 260)), 
+      POLYGON(
+        (280 400, 320 400, 320 360, 300 360, 280 360, 280 400)), 
+      POLYGON(
+        (300 240, 320 240, 320 220, 300 220, 300 240)))
+  </op>
+</test>
+<test>
+  <op name="difference" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (280 240, 280 120, 60 120, 60 320, 220 320, 280 320, 280 240), 
+        (120 260, 120 180, 240 180, 240 240, 240 260, 220 260, 120 260)), 
+      (
+        (280 400, 320 400, 320 360, 300 360, 280 360, 280 400)), 
+      (
+        (300 240, 320 240, 320 220, 300 220, 300 240)))
+  </op>
+</test>
+<test>
+  <op name="union" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(220 360, 220 320), 
+      LINESTRING(220 260, 220 240, 240 240), 
+      LINESTRING(280 240, 300 240), 
+      LINESTRING(300 240, 300 360), 
+      POLYGON(
+        (280 240, 280 120, 60 120, 60 320, 220 320, 280 320, 280 240), 
+        (120 260, 120 180, 240 180, 240 240, 240 260, 220 260, 120 260)), 
+      POLYGON(
+        (280 400, 320 400, 320 360, 300 360, 280 360, 280 400)), 
+      POLYGON(
+        (300 240, 320 240, 320 220, 300 220, 300 240)))
+  </op>
+</test>
+<test>
+  <op name="intersection" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(300 240), 
+      POINT(300 360), 
+      LINESTRING(80 300, 80 160), 
+      LINESTRING(80 160, 260 160, 260 240), 
+      LINESTRING(260 240, 260 300, 220 300), 
+      LINESTRING(220 300, 80 300), 
+      LINESTRING(80 160, 80 140), 
+      LINESTRING(220 320, 220 300), 
+      LINESTRING(220 300, 220 260), 
+      LINESTRING(240 240, 260 240), 
+      LINESTRING(260 240, 280 240))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mLmA - A and B complex, overlapping and touching #3</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (120 180, 60 80, 180 80, 120 180)), 
+      (
+        (100 240, 140 240, 120 220, 100 240)))
+  </a>
+  <b>
+    MULTILINESTRING(
+      (180 260, 120 180, 60 260, 180 260), 
+      (60 300, 60 40), 
+      (100 100, 140 100))
+  </b>
+<test>
+  <op name="convexhull" pattern="FFFFFFFFF" arg1="A">
+    POLYGON(
+      (60 80, 100 240, 140 240, 180 80, 60 80))
+  </op>
+</test>
+<test>
+  <op name="getboundary" pattern="FFFFFFFFF" arg1="A">
+    MULTILINESTRING(
+      (120 180, 60 80, 180 80, 120 180), 
+      (100 240, 140 240, 120 220, 100 240))
+  </op>
+</test>
+<test>
+  <op name="symdifference" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(180 260, 120 180), 
+      LINESTRING(120 180, 60 260), 
+      LINESTRING(60 260, 180 260), 
+      LINESTRING(60 300, 60 260), 
+      LINESTRING(60 260, 60 80), 
+      LINESTRING(60 80, 60 40), 
+      POLYGON(
+        (60 80, 120 180, 180 80, 60 80)), 
+      POLYGON(
+        (100 240, 140 240, 120 220, 100 240)))
+  </op>
+</test>
+<test>
+  <op name="difference" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (60 80, 120 180, 180 80, 60 80)), 
+      (
+        (100 240, 140 240, 120 220, 100 240)))
+  </op>
+</test>
+<test>
+  <op name="union" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(180 260, 120 180), 
+      LINESTRING(120 180, 60 260), 
+      LINESTRING(60 260, 180 260), 
+      LINESTRING(60 300, 60 260), 
+      LINESTRING(60 260, 60 80), 
+      LINESTRING(60 80, 60 40), 
+      POLYGON(
+        (60 80, 120 180, 180 80, 60 80)), 
+      POLYGON(
+        (100 240, 140 240, 120 220, 100 240)))
+  </op>
+</test>
+<test>
+  <op name="intersection" pattern="FFFFFFFFF" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(60 80), 
+      POINT(120 180), 
+      LINESTRING(100 100, 140 100))
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionLAPrec.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionLAPrec.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionLAPrec.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,59 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LA - line and sliver intersecting, dimensional collapse</desc>
+  <a>
+    POLYGON(
+      (95 9, 81 414, 87 414, 95 9))
+  </a>
+  <b>
+    LINESTRING(93 13, 96 13)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    LINESTRING(95 9, 81 414, 87 414, 95 9)
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (95 9, 81 414, 87 414, 95 9))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(95 13)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(95 9, 95 13), 
+      POLYGON(
+        (95 13, 81 414, 87 414, 95 13)), 
+      LINESTRING(93 13, 95 13), 
+      LINESTRING(95 13, 96 13))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(95 9, 95 13), 
+      POLYGON(
+        (95 13, 81 414, 87 414, 95 13)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      LINESTRING(95 9, 95 13), 
+      POLYGON(
+        (95 13, 81 414, 87 414, 95 13)), 
+      LINESTRING(93 13, 95 13), 
+      LINESTRING(95 13, 96 13))
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionLL.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionLL.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionLL.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,375 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LL - A crosses B</desc>
+  <a>
+    LINESTRING(0 0, 100 100)
+  </a>
+  <b>
+    LINESTRING(0 100, 100 0)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(50 50)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (0 0, 50 50), 
+      (0 100, 50 50), 
+      (50 50, 100 100), 
+      (50 50, 100 0))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (0 0, 50 50), 
+      (50 50, 100 100))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (0 0, 50 50), 
+      (0 100, 50 50), 
+      (50 50, 100 100), 
+      (50 50, 100 0))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A shares one segment with B</desc>
+  <a>
+    LINESTRING(0 0, 100 100, 200 0)
+  </a>
+  <b>
+    LINESTRING(0 0, 100 100, 200 200)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    LINESTRING(0 0, 100 100)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (0 0, 100 100), 
+      (100 100, 200 200), 
+      (100 100, 200 0))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    LINESTRING(100 100, 200 0)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (100 100, 200 200), 
+      (100 100, 200 0))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A and B disjoint</desc>
+  <a>
+    LINESTRING(40 360, 40 220, 120 360)
+  </a>
+  <b>
+    LINESTRING(120 340, 60 220, 140 220, 140 360)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((40 360), (120 360))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (40 220, 40 360, 120 360, 40 220))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (40 360, 40 220, 120 360), 
+      (120 340, 60 220, 140 220, 140 360))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    LINESTRING(40 360, 40 220, 120 360)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (40 360, 40 220, 120 360), 
+      (120 340, 60 220, 140 220, 140 360))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A and B intersect frequently</desc>
+  <a>
+    LINESTRING(220 240, 200 220, 60 320, 40 300, 180 200, 160 180, 20 280)
+  </a>
+  <b>
+    LINESTRING(220 240, 140 160, 120 180, 220 280, 200 300, 100 200)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((220 240), (20 280))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (160 180, 20 280, 60 320, 220 240, 160 180))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(113 213), 
+      POINT(133 233), 
+      POINT(137 197), 
+      POINT(153 253), 
+      POINT(157 217), 
+      POINT(177 237), 
+      LINESTRING(180 200, 160 180), 
+      LINESTRING(220 240, 200 220))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (113 213, 20 280), 
+      (133 233, 113 213), 
+      (113 213, 100 200), 
+      (137 197, 113 213), 
+      (153 253, 133 233), 
+      (153 253, 60 320, 40 300, 133 233), 
+      (133 233, 157 217), 
+      (137 197, 157 217), 
+      (160 180, 140 160, 120 180, 137 197), 
+      (160 180, 137 197), 
+      (177 237, 220 280, 200 300, 153 253), 
+      (177 237, 153 253), 
+      (157 217, 177 237), 
+      (157 217, 180 200), 
+      (180 200, 160 180), 
+      (200 220, 177 237), 
+      (200 220, 180 200), 
+      (220 240, 200 220))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (200 220, 177 237), 
+      (177 237, 153 253), 
+      (153 253, 60 320, 40 300, 133 233), 
+      (133 233, 157 217), 
+      (157 217, 180 200), 
+      (160 180, 137 197), 
+      (137 197, 113 213), 
+      (113 213, 20 280))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (200 220, 177 237), 
+      (177 237, 153 253), 
+      (153 253, 60 320, 40 300, 133 233), 
+      (133 233, 157 217), 
+      (157 217, 180 200), 
+      (160 180, 137 197), 
+      (137 197, 113 213), 
+      (113 213, 20 280), 
+      (200 220, 180 200), 
+      (160 180, 140 160, 120 180, 137 197), 
+      (137 197, 157 217), 
+      (157 217, 177 237), 
+      (177 237, 220 280, 200 300, 153 253), 
+      (153 253, 133 233), 
+      (133 233, 113 213), 
+      (113 213, 100 200))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A and B equal</desc>
+  <a>
+    LINESTRING(80 320, 220 320, 220 160, 80 300)
+  </a>
+  <b>
+    LINESTRING(80 320, 220 320, 220 160, 80 300)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((80 320), (80 300))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (220 160, 80 300, 80 320, 220 320, 220 160))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (220 160, 80 300), 
+      (80 320, 220 320), 
+      (220 320, 220 160))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (220 160, 80 300), 
+      (80 320, 220 320), 
+      (220 320, 220 160))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - A and B touch ends</desc>
+  <a>
+    LINESTRING(60 200, 60 260, 140 200)
+  </a>
+  <b>
+    LINESTRING(60 200, 60 140, 140 200)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((60 200), (140 200))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (60 200, 60 260, 140 200, 60 200))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((60 200), (140 200))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (60 200, 60 260, 140 200), 
+      (60 200, 60 140, 140 200))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    LINESTRING(60 200, 60 260, 140 200)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (60 200, 60 260, 140 200), 
+      (60 200, 60 140, 140 200))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LL - intersecting rings</desc>
+  <a>
+    LINESTRING(180 200, 100 280, 20 200, 100 120, 180 200)
+  </a>
+  <b>
+    LINESTRING(100 200, 220 200, 220 80, 100 80, 100 200)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT EMPTY
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (100 120, 20 200, 100 280, 180 200, 100 120))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((100 120), (180 200))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (100 120, 180 200), 
+      (100 120, 100 200), 
+      (180 200, 100 280, 20 200, 100 120), 
+      (180 200, 220 200, 220 80, 100 80, 100 120), 
+      (100 200, 180 200))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (100 120, 180 200), 
+      (180 200, 100 280, 20 200, 100 120))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (100 120, 180 200), 
+      (100 120, 100 200), 
+      (180 200, 100 280, 20 200, 100 120), 
+      (180 200, 220 200, 220 80, 100 80, 100 120), 
+      (100 200, 180 200))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>LrL - LinearRing bug</desc>
+  <a>
+    LINEARRING(0 0, 0 5, 5 5, 5 0, 0 0)
+  </a>
+  <b>
+    LINESTRING( 2 2, 5 5)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT (5 5)
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionLLPrec.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionLLPrec.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionLLPrec.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,28 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>LL - narrow V</desc>
+  <a>
+    LINESTRING(0 10, 620 10, 0 11)
+  </a>
+  <b>
+    LINESTRING(400 60, 400 10)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(400 10)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (0 10, 400 10), 
+      (400 10, 620 10, 400 10), 
+      (400 10, 0 11), 
+      (400 60, 400 10))
+  </op>
+</test>
+</case>
+
+</run>
\ No newline at end of file

Added: trunk/tests/xmltester/tests/general/TestFunctionPA.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionPA.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionPA.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,155 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>PA - point contained in simple polygon</desc>
+  <a>
+    POINT(100 100)
+  </a>
+  <b>
+    POLYGON(
+      (50 50, 200 50, 200 200, 50 200, 50 50))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(100 100)
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPmA - points on I, B and E of touching triangles</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (120 320, 180 200, 240 320, 120 320)), 
+      (
+        (180 200, 240 80, 300 200, 180 200)))
+  </a>
+  <b>
+    MULTIPOINT((120 320), (180 260), (180 320), (180 200), (300 200), (200 220))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTILINESTRING(
+      (120 320, 180 200, 240 320, 120 320), 
+      (180 200, 240 80, 300 200, 180 200))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (240 80, 120 320, 240 320, 300 200, 240 80))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((120 320), (180 200), (180 260), (180 320), (300 200))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(200 220), 
+      POLYGON(
+        (180 200, 120 320, 240 320, 180 200)), 
+      POLYGON(
+        (180 200, 300 200, 240 80, 180 200)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (180 200, 120 320, 240 320, 180 200)), 
+      (
+        (180 200, 300 200, 240 80, 180 200)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(200 220), 
+      POLYGON(
+        (180 200, 120 320, 240 320, 180 200)), 
+      POLYGON(
+        (180 200, 300 200, 240 80, 180 200)))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPmA - points on I, B and E of concentric doughnuts</desc>
+  <a>
+    MULTIPOLYGON(
+      (
+        (120 80, 420 80, 420 340, 120 340, 120 80), 
+        (160 300, 160 120, 380 120, 380 300, 160 300)), 
+      (
+        (200 260, 200 160, 340 160, 340 260, 200 260), 
+        (240 220, 240 200, 300 200, 300 220, 240 220)))
+  </a>
+  <b>
+    MULTIPOINT((200 360), (420 340), (400 100), (340 120), (200 140), (200 160), (220 180), (260 200), (200 360), 
+    (420 340), (400 100), (340 120), (200 140), (200 160), (220 180), (260 200))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTILINESTRING(
+      (120 80, 420 80, 420 340, 120 340, 120 80), 
+      (160 300, 160 120, 380 120, 380 300, 160 300), 
+      (200 260, 200 160, 340 160, 340 260, 200 260), 
+      (240 220, 240 200, 300 200, 300 220, 240 220))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (120 80, 120 340, 420 340, 420 80, 120 80))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((200 160), (220 180), (260 200), (340 120), (400 100), (420 340))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(200 140), 
+      POINT(200 360), 
+      POLYGON(
+        (120 80, 120 340, 420 340, 420 80, 120 80), 
+        (160 300, 160 120, 380 120, 380 300, 160 300)), 
+      POLYGON(
+        (200 260, 340 260, 340 160, 200 160, 200 260), 
+        (240 220, 240 200, 300 200, 300 220, 240 220)))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOLYGON(
+      (
+        (120 80, 120 340, 420 340, 420 80, 120 80), 
+        (160 300, 160 120, 380 120, 380 300, 160 300)), 
+      (
+        (200 260, 340 260, 340 160, 200 160, 200 260), 
+        (240 220, 240 200, 300 200, 300 220, 240 220)))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(200 140), 
+      POINT(200 360), 
+      POLYGON(
+        (120 80, 120 340, 420 340, 420 80, 120 80), 
+        (160 300, 160 120, 380 120, 380 300, 160 300)), 
+      POLYGON(
+        (200 260, 340 260, 340 160, 200 160, 200 260), 
+        (240 220, 240 200, 300 200, 300 220, 240 220)))
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionPL.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionPL.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionPL.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,286 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>mPL - points in I and E of line</desc>
+  <a>
+    MULTIPOINT((40 90), (20 20), (70 70))
+  </a>
+  <b>
+    LINESTRING(20 20, 100 100)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((20 20), (70 70))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(40 90), 
+      LINESTRING(20 20, 100 100))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POINT(40 90)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(40 90), 
+      LINESTRING(20 20, 100 100))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPL - points in I and E of line, line self-intersecting</desc>
+  <a>
+    MULTIPOINT((40 90), (20 20), (70 70))
+  </a>
+  <b>
+    LINESTRING(20 20, 110 110, 170 50, 130 10, 70 70)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((20 20), (70 70))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(40 90), 
+      LINESTRING(20 20, 70 70), 
+      LINESTRING(70 70, 110 110, 170 50, 130 10, 70 70))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POINT(40 90)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(40 90), 
+      LINESTRING(20 20, 70 70), 
+      LINESTRING(70 70, 110 110, 170 50, 130 10, 70 70))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPmL - points in I, B and E of lines, lines overlap, points overlap</desc>
+  <a>
+    MULTILINESTRING(
+      (100 320, 100 220), 
+      (100 180, 200 180), 
+      (220 180, 220 320), 
+      (220 320, 160 320), 
+      (100 320, 100 220), 
+      (100 180, 200 180), 
+      (220 180, 220 320), 
+      (220 320, 160 320), 
+      (100 220, 100 320))
+  </a>
+  <b>
+    MULTIPOINT ((100 320), (100 260), (100 220), (100 200), (100 180), (120 180), (200 180), (220 180), (220 260), (220 320), (200 320), (160 320), (140 320), (120 320), (100 320), (100 260), (100 220), (100 200), (100 180), (120 180), (200 180), (220 180), (220 260), (220 320), (200 320), (160 320), (140 320), (120 320))  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((100 220), (100 320))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (100 180, 100 320, 220 320, 220 180, 100 180))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT ((100 180), (100 220), (100 260), (100 320), (120 180), (160 320), (200 180), (200 320), (220 180), (220 260), (220 320))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(100 200), 
+      POINT(120 320), 
+      POINT(140 320), 
+      LINESTRING(100 320, 100 220), 
+      LINESTRING(100 180, 200 180), 
+      LINESTRING(220 180, 220 320), 
+      LINESTRING(220 320, 160 320))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (100 320, 100 220), 
+      (100 180, 200 180), 
+      (220 180, 220 320), 
+      (220 320, 160 320))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(100 200), 
+      POINT(120 320), 
+      POINT(140 320), 
+      LINESTRING(100 320, 100 220), 
+      LINESTRING(100 180, 200 180), 
+      LINESTRING(220 180, 220 320), 
+      LINESTRING(220 320, 160 320))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPmL - points in I, B and E of lines, lines overlap, points overlap, x &lt;0, y &lt; 0</desc>
+  <a>
+    MULTILINESTRING(
+      (-500 -140, -500 -280, -320 -280, -320 -140, -500 -140, -500 -340), 
+      (-500 -140, -320 -140, -500 -140, -320 -140, -500 -140))
+  </a>
+  <b>
+    MULTIPOINT ((-560 -180), (-420 -180), (-500 -220), (-500 -340), (-500 -280), (-500 -140), (-320 -140), (-420 -140), (-320 -180), (-280 -140), (-320 -120), (-560 -180), (-420 -180), (-500 -220), (-500 -340), (-500 -280), (-500 -140), (-320 -140), (-420 -140), (-320 -180), (-280 -140), (-320 -120))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((-500 -340), (-500 -140))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (-500 -340, -500 -140, -320 -140, -320 -280, -500 -340))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((-500 -340), (-500 -280), (-500 -220), (-500 -140), (-420 -140), (-320 -180), (-320 -140))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(-560 -180), 
+      POINT(-420 -180), 
+      POINT(-320 -120), 
+      POINT(-280 -140), 
+      LINESTRING(-500 -140, -500 -280), 
+      LINESTRING(-500 -280, -320 -280, -320 -140), 
+      LINESTRING(-320 -140, -500 -140), 
+      LINESTRING(-500 -280, -500 -340))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (-500 -140, -500 -280), 
+      (-500 -280, -320 -280, -320 -140), 
+      (-320 -140, -500 -140), 
+      (-500 -280, -500 -340))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(-560 -180), 
+      POINT(-420 -180), 
+      POINT(-320 -120), 
+      POINT(-280 -140), 
+      LINESTRING(-500 -140, -500 -280), 
+      LINESTRING(-500 -280, -320 -280, -320 -140), 
+      LINESTRING(-320 -140, -500 -140), 
+      LINESTRING(-500 -280, -500 -340))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mL - lines intersect at 1 point</desc>
+  <a>
+    MULTILINESTRING(
+      (180 100, 140 280, 240 140, 220 120, 140 280), 
+      (140 280, 100 400, 80 380, 140 280, 40 380, 20 360, 140 280))
+  </a>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((180 100), (140 280))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPmL - points in I, B and E of lines, lines overlap, points overlap</desc>
+  <a>
+    MULTILINESTRING(
+      (100 320, 100 220), 
+      (100 180, 200 180), 
+      (220 180, 220 320), 
+      (220 320, 160 320), 
+      (100 320, 100 220), 
+      (100 180, 200 180), 
+      (220 180, 220 320), 
+      (220 320, 160 320), 
+      (100 220, 100 320))
+  </a>
+  <b>
+    MULTIPOINT ((100 320), (100 260), (100 220), (100 200), (100 180), (120 180), (200 180), (220 180), (220 260), (220 320), (200 320), (160 320), (140 320), (120 320), (100 320), (100 260), (100 220), (100 200), (100 180), (120 180), (200 180), (220 180), (220 260), (220 320), (200 320), (160 320), (140 320), (120 320))
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    MULTIPOINT((100 220), (100 320))
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POLYGON(
+      (100 180, 100 320, 220 320, 220 180, 100 180))
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT ((100 180), (100 220), (100 260), (100 320), (120 180), (160 320), (200 180), (200 320), (220 180), (220 260), (220 320))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(100 200), 
+      POINT(120 320), 
+      POINT(140 320), 
+      LINESTRING(100 320, 100 220), 
+      LINESTRING(100 180, 200 180), 
+      LINESTRING(220 180, 220 320), 
+      LINESTRING(220 320, 160 320))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTILINESTRING(
+      (100 320, 100 220), 
+      (100 180, 200 180), 
+      (220 180, 220 320), 
+      (220 320, 160 320))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION(
+      POINT(100 200), 
+      POINT(120 320), 
+      POINT(140 320), 
+      LINESTRING(100 320, 100 220), 
+      LINESTRING(100 180, 200 180), 
+      LINESTRING(220 180, 220 320), 
+      LINESTRING(220 320, 160 320))
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionPLPrec.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionPLPrec.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionPLPrec.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,19 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>PP - Point just off line. Causes non-robust algorithms to fail.</desc>
+  <a>
+    LINESTRING(-123456789 -40, 381039468754763 123456789)
+  </a>
+  <b>
+    POINT(0 0)
+  </b>
+<test>
+  <op name="intersects" arg1="A" arg2="B">
+    false
+  </op>
+</test>
+</case>
+
+</run>

Added: trunk/tests/xmltester/tests/general/TestFunctionPP.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestFunctionPP.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/general/TestFunctionPP.xml	2009-05-02 09:20:26 UTC (rev 2452)
@@ -0,0 +1,269 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>PP - point contained in both A and B</desc>
+  <a>
+    POINT(100 100)
+  </a>
+  <b>
+    POINT(100 100)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(100 100)
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PP - A different from B</desc>
+  <a>
+    POINT(100 100)
+  </a>
+  <b>
+    POINT(200 200)
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOINT((100 100), (200 200))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POINT(100 100)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOINT((100 100), (200 200))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PmP - point in A contained in B</desc>
+  <a>
+    POINT(100 100)
+  </a>
+  <b>
+    MULTIPOINT((100 100), (200 200))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(100 100)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOINT((100 100), (200 200))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    POINT(200 200)
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>mPmP - points in A only, B only, and in both</desc>
+  <a>
+    MULTIPOINT((100 100), (200 200), (300 300), (500 500))
+  </a>
+  <b>
+    MULTIPOINT((100 100), (200 200), (400 400), (600 600))
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    MULTIPOINT((100 100), (200 200))
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOINT ((100 100), (200 200), (300 300), (400 400), (500 500), (600 600))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    MULTIPOINT((300 300), (500 500))
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOINT((300 300), (400 400), (500 500), (600 600))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PP - point contained in both A and B</desc>
+  <a>
+    POINT(80 200)
+  </a>
+  <b>
+    POINT(80 200)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POINT(80 200)
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    POINT(80 200)
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    POINT(80 200)
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PP - A different from B</desc>
+  <a>
+    POINT(80 200)
+  </a>
+  <b>
+    POINT(260 80)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POINT(80 200)
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOINT((80 200), (260 80))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POINT(80 200)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOINT((80 200), (260 80))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PP - A different from B, same y</desc>
+  <a>
+    POINT(60 260)
+  </a>
+  <b>
+    POINT(120 260)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POINT(60 260)
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOINT((60 260), (120 260))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POINT(60 260)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOINT((60 260), (120 260))
+  </op>
+</test>
+</case>
+
+<case>
+  <desc>PP - A different from B, same x</desc>
+  <a>
+    POINT(80 80)
+  </a>
+  <b>
+    POINT(80 280)
+  </b>
+<test>
+  <op name="getboundary" arg1="A">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="convexhull" arg1="A">
+    POINT(80 80)
+  </op>
+</test>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+    GEOMETRYCOLLECTION EMPTY
+  </op>
+</test>
+<test>
+  <op name="union" arg1="A" arg2="B">
+    MULTIPOINT((80 80), (80 280))
+  </op>
+</test>
+<test>
+  <op name="difference" arg1="A" arg2="B">
+    POINT(80 80)
+  </op>
+</test>
+<test>
+  <op name="symdifference" arg1="A" arg2="B">
+    MULTIPOINT((80 80), (80 280))
+  </op>
+</test>
+</case>
+
+</run>



More information about the geos-commits mailing list