[geos-commits] r2362 - in trunk: source/algorithm tests/xmltester tests/xmltester/tests

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Apr 14 15:11:29 EDT 2009


Author: strk
Date: 2009-04-14 15:11:29 -0400 (Tue, 14 Apr 2009)
New Revision: 2362

Added:
   trunk/tests/xmltester/tests/TestBufferMitredJoin.xml
Modified:
   trunk/source/algorithm/HCoordinate.cpp
   trunk/tests/xmltester/Makefile.am
Log:
Temporarly revert the unrolled computation in HCoordinate::intersection. Added mitred join buffer test from JTS (failed with the unrolled comp, to be further inspected).


Modified: trunk/source/algorithm/HCoordinate.cpp
===================================================================
--- trunk/source/algorithm/HCoordinate.cpp	2009-04-14 16:43:40 UTC (rev 2361)
+++ trunk/source/algorithm/HCoordinate.cpp	2009-04-14 19:11:29 UTC (rev 2362)
@@ -42,74 +42,6 @@
 namespace geos {
 namespace algorithm { // geos.algorithm
 
-///*public static*/
-//void
-//HCoordinate::OLDintersection(const Coordinate &p1, const Coordinate &p2,
-//	const Coordinate &q1, const Coordinate &q2, Coordinate &ret)
-//{
-//
-//#if GEOS_DEBUG
-//	cerr << __FUNCTION__ << ":" << endl
-//	     << setprecision(20)
-//	     << " p1: " << p1 << endl
-//	     << " p2: " << p2 << endl
-//	     << " q1: " << q1 << endl
-//	     << " q2: " << q2 << endl;
-//#endif
-//
-//        HCoordinate hc1p1(p1);
-//
-//#if GEOS_DEBUG
-//	cerr << "HCoordinate(p1): "
-//	     << hc1p1 << endl;
-//#endif
-//
-//        HCoordinate hc1p2(p2);
-//
-//#if GEOS_DEBUG
-//	cerr << "HCoordinate(p2): "
-//	     << hc1p2 << endl;
-//#endif
-//
-//        HCoordinate l1(hc1p1, hc1p2);
-//
-//#if GEOS_DEBUG
-//	cerr << "L1 - HCoordinate(HCp1, HCp2): "
-//	     << l1 << endl;
-//#endif
-//
-//        HCoordinate hc2q1(q1);
-//
-//#if GEOS_DEBUG
-//	cerr << "HCoordinate(q1): "
-//	     << hc2q1 << endl;
-//#endif
-//
-//        HCoordinate hc2q2(q2);
-//
-//#if GEOS_DEBUG
-//	cerr << "HCoordinate(q2): "
-//	     << hc2q2 << endl;
-//#endif
-//
-//        HCoordinate l2(hc2q1, hc2q2);
-//
-//#if GEOS_DEBUG
-//	cerr << "L2 - HCoordinate(HCq1, HCq2): "
-//	     << l2 << endl;
-//#endif
-//
-//        HCoordinate intHCoord(l1, l2);
-//
-//#if GEOS_DEBUG
-//	cerr << "HCoordinate(L1, L2): "
-//	     << intHCoord << endl;
-//#endif
-//
-//        intHCoord.getCoordinate(ret);
-//
-//}
-
 /*public static*/
 void
 HCoordinate::intersection(const Coordinate &p1, const Coordinate &p2,
@@ -125,6 +57,7 @@
 	     << " q2: " << q2 << endl;
 #endif
 
+#if 0 // TODO: fix this, results in a testcase failure!
 	// unrolled computation
 
 	double px = p1.y - p2.y;
@@ -148,6 +81,20 @@
 	}
 
 	ret = Coordinate(xInt, yInt);
+#else
+
+	HCoordinate hc1p1(p1);
+	HCoordinate hc1p2(p2);
+	HCoordinate l1(hc1p1, hc1p2);
+
+	HCoordinate hc2q1(q1);
+	HCoordinate hc2q2(q2);
+	HCoordinate l2(hc2q1, hc2q2);
+
+	HCoordinate intHCoord(l1, l2);
+	intHCoord.getCoordinate(ret);
+#endif
+
 }
 
 /*public*/

Modified: trunk/tests/xmltester/Makefile.am
===================================================================
--- trunk/tests/xmltester/Makefile.am	2009-04-14 16:43:40 UTC (rev 2361)
+++ trunk/tests/xmltester/Makefile.am	2009-04-14 19:11:29 UTC (rev 2362)
@@ -8,7 +8,7 @@
 
 EXTRA_DIST = testrunner.sh
 
-SAFE_XMLTESTS=$(srcdir)/tests/testLeaksBig.xml $(srcdir)/tests/hexwkb.xml $(srcdir)/tests/test.xml $(srcdir)/tests/linemerge.xml $(srcdir)/tests/TestInteriorPoint.xml $(srcdir)/tests/TestCentroid.xml $(srcdir)/tests/TestIsValid.xml $(srcdir)/tests/TestValid.xml $(srcdir)/tests/TestValid2.xml $(srcdir)/tests/TestValid2-big.xml $(srcdir)/tests/robustness.xml $(srcdir)/tests/stmlf-cases-20061020.xml $(srcdir)/tests/TestRobustOverlayFixed.xml $(srcdir)/tests/fme.xml $(srcdir)/tests/TestBuffer.xml $(srcdir)/tests/TestBufferExternal.xml $(srcdir)/tests/TestBufferExternal2.xml $(srcdir)/tests/heisenbugs.xml $(srcdir)/tests/stmlf-cases-20070119.xml $(srcdir)/tests/badguy3.xml $(srcdir)/tests/hole_from_shell.xml $(srcdir)/tests/hole_red.xml
+SAFE_XMLTESTS=$(srcdir)/tests/testLeaksBig.xml $(srcdir)/tests/hexwkb.xml $(srcdir)/tests/test.xml $(srcdir)/tests/linemerge.xml $(srcdir)/tests/TestInteriorPoint.xml $(srcdir)/tests/TestCentroid.xml $(srcdir)/tests/TestIsValid.xml $(srcdir)/tests/TestValid.xml $(srcdir)/tests/TestValid2.xml $(srcdir)/tests/TestValid2-big.xml $(srcdir)/tests/robustness.xml $(srcdir)/tests/stmlf-cases-20061020.xml $(srcdir)/tests/TestRobustOverlayFixed.xml $(srcdir)/tests/fme.xml $(srcdir)/tests/TestBuffer.xml $(srcdir)/tests/TestBufferExternal.xml $(srcdir)/tests/TestBufferExternal2.xml $(srcdir)/tests/TestBufferMitredJoin.xml $(srcdir)/tests/heisenbugs.xml $(srcdir)/tests/stmlf-cases-20070119.xml $(srcdir)/tests/badguy3.xml $(srcdir)/tests/hole_from_shell.xml $(srcdir)/tests/hole_red.xml
 
 XMLTESTS=$(SAFE_XMLTESTS) 
 

Added: trunk/tests/xmltester/tests/TestBufferMitredJoin.xml
===================================================================
--- trunk/tests/xmltester/tests/TestBufferMitredJoin.xml	                        (rev 0)
+++ trunk/tests/xmltester/tests/TestBufferMitredJoin.xml	2009-04-14 19:11:29 UTC (rev 2362)
@@ -0,0 +1,60 @@
+<run>
+  <desc>
+    Test cases for buffers with mitred joins.
+  </desc>
+  <precisionModel type="FLOATING" />
+  <resultMatcher>com.vividsolutions.jtstest.testrunner.BufferResultMatcher</resultMatcher>
+
+<case>
+ <desc>Polygon with very close vertices  </desc>
+  <a>
+POLYGON ((588736.6028960398 4518922.914991864, 588736.1060708747 4518922.061957178, 588718.6830715544 4518930.620699637, 588712.0102834741 4518933.8985304395, 588722.7612465625 4518964.956739423, 588755.2073151038 4518948.2420851765, 588750.2892019567 4518938.490656119, 588750.2892047082 4518938.490654858, 588741.1098934844 4518920.290260831, 588736.6028960398 4518922.914991864))
+  </a>
+<test><op name='bufferMitredJoin' arg1='A' arg2='-5.0'>   
+POLYGON ((588734.1297355227 4518928.603500288, 588720.8876067492 4518935.108463509, 588718.180507909 4518936.438254274, 588725.599306024 4518957.870248819, 588748.510613743 4518946.067444841, 588745.824857241 4518940.742239175, 588739.0370049385 4518927.28353524, 588734.7985587667 4518929.751873097, 588734.1297355227 4518928.603500288))
+	</op></test>
+</case>
+
+<case>
+ <desc>Polygon with almost collinear segments  </desc>
+  <a>
+    POLYGON ((589300.089821923 4519627.577687806, 589296.6197410262 4519621.834087054, 589292.5450979208 4519615.089809029, 589282.7894421419 4519620.983829066, 589289.8814929381 4519632.722288636, 589300.089821923 4519627.577687806))
+  </a>
+<test><op name='bufferMitredJoin' arg1='A' arg2='-5.0'>   
+POLYGON ((589293.0184401305 4519625.542333956, 589292.3401596148 4519624.419659127, 589290.8510825798 4519621.954964854, 589289.654619631 4519622.677825188, 589291.766473935 4519626.173276233, 589293.0184401305 4519625.542333956))
+	</op></test>
+</case>
+
+<case>
+ <desc>Polygon with almost collinear segments  </desc>
+  <a>
+POLYGON ((588978.2942617612 4519797.499233156, 588989.1612999197 4519792.050291001, 588982.5784094566 4519779.549041149, 588962.0866377753 4519790.334848753, 588967.4026187821 4519802.960530801, 588978.2942617612 4519797.499233156))
+  </a>
+<test><op name='bufferMitredJoin' arg1='A' arg2='-5.0'>   
+POLYGON ((588976.0531144794 4519793.029640461, 588982.3607149989 4519789.866888121, 588980.48352001 4519786.3019976355, 588968.47502784 4519792.622646146, 588969.9375199836 4519796.09612748, 588976.0531144794 4519793.029640461))
+	</op></test>
+</case>
+
+<case>
+ <desc>Polygon with almost collinear segments  </desc>
+  <a>
+POLYGON ((589099.8017397423 4518490.719003885, 589097.1198886324 4518486.20858194, 589090.9424687021 4518475.819013388, 589069.8993093553 4518487.1362185385, 589078.7377975255 4518502.093799692, 589081.1515112884 4518509.334764771, 589103.7370954598 4518497.015419995, 589099.8017397423 4518490.719003885))
+  </a>
+<test><op name='bufferMitredJoin' arg1='A' arg2='-5.0'>  
+POLYGON ((589095.5298653984 4518493.317948498, 589092.8222002359 4518488.763943842, 589089.0925332544 4518482.491158241, 589076.8521287646 4518489.074160654, 589083.3129233124 4518500.0079495255, 589084.0046933009 4518502.083060501, 589096.6851902619 4518495.166462162, 589095.5298653984 4518493.317948498)) 
+	</op></test>
+</case>
+
+<case>
+ <desc>Polygon with very close vertices  </desc>
+  <a>
+POLYGON ((587854.8616905196 4519121.941123185, 587863.6671614297 4519138.176489661, 587863.9386104685 4519138.676991724, 587880.5408633598 4519129.672513268, 587871.463857397 4519112.9366913745, 587854.8616905196 4519121.941123185))
+  </a>
+<test><op name='bufferMitredJoin' arg1='A' arg2='-5.0'>  
+POLYGON ((587861.6406480775 4519123.952511722, 587865.9500049312 4519131.898025201, 587873.7618842344 4519127.661136427, 587869.4524883915 4519119.715644092, 587861.6406480775 4519123.952511722))
+	</op></test>
+</case>
+
+
+
+</run>


Property changes on: trunk/tests/xmltester/tests/TestBufferMitredJoin.xml
___________________________________________________________________
Name: svn:mergeinfo
   + 



More information about the geos-commits mailing list