[geos-commits] r3732 - in branches/3.3: . src/operation/buffer

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Dec 4 23:41:47 PST 2012


Author: strk
Date: 2012-12-04 23:41:45 -0800 (Tue, 04 Dec 2012)
New Revision: 3732

Modified:
   branches/3.3/NEWS
   branches/3.3/src/operation/buffer/BufferOp.cpp
Log:
Do not reduce precision below 6 significant digits.

Avoids gross results (preferring an exception)
See http://trac.osgeo.org/geos/ticket/605

Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS	2012-12-04 21:50:30 UTC (rev 3731)
+++ branches/3.3/NEWS	2012-12-05 07:41:45 UTC (rev 3732)
@@ -3,6 +3,8 @@
 
 - Bug fixes / improvements
     - Fix abort in RightmostEdgeFinder (#605)
+    - Do not force precision reduction below 6 significant digits
+      while trying to obtain a valid Buffer output (#605)
 
 Changes in 3.3.6
 2012-11-15 -- that's Post-GIS day !

Modified: branches/3.3/src/operation/buffer/BufferOp.cpp
===================================================================
--- branches/3.3/src/operation/buffer/BufferOp.cpp	2012-12-04 21:50:30 UTC (rev 3731)
+++ branches/3.3/src/operation/buffer/BufferOp.cpp	2012-12-05 07:41:45 UTC (rev 3732)
@@ -152,8 +152,11 @@
 BufferOp::bufferReducedPrecision()
 {
 
-	// try and compute with decreasing precision
-	for (int precDigits=MAX_PRECISION_DIGITS; precDigits >= 0; precDigits--)
+	// try and compute with decreasing precision,
+	// up to a min, to avoid gross results
+	// (not in JTS, see http://trac.osgeo.org/geos/ticket/605)
+#define MIN_PRECISION_DIGITS 6
+	for (int precDigits=MAX_PRECISION_DIGITS; precDigits >= MIN_PRECISION_DIGITS; precDigits--)
 	{
 #if GEOS_DEBUG
 		std::cerr<<"BufferOp::computeGeometry: trying with precDigits "<<precDigits<<std::endl;



More information about the geos-commits mailing list