[geos-commits] r3711 - trunk/include/geos/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Sep 10 00:56:56 PDT 2012


Author: strk
Date: 2012-09-10 00:56:56 -0700 (Mon, 10 Sep 2012)
New Revision: 3711

Modified:
   trunk/include/geos/geom/BinaryOp.h
Log:
Do not try to fix valid geometries (#586)

Modified: trunk/include/geos/geom/BinaryOp.h
===================================================================
--- trunk/include/geos/geom/BinaryOp.h	2012-09-07 12:01:41 UTC (rev 3710)
+++ trunk/include/geos/geom/BinaryOp.h	2012-09-10 07:56:56 UTC (rev 3711)
@@ -155,8 +155,12 @@
 inline std::auto_ptr<Geometry>
 fix_self_intersections(std::auto_ptr<Geometry> g, const std::string& label)
 {
-  // TODO: check for presence of self-intersections first ?
-  return g->Union();
+#ifdef GEOS_DEBUG_BINARYOP
+	std::cerr << label << " fix_self_intersection (UnaryUnion)" << std::endl;
+#endif
+  // TODO: check for the sole self-intersections case ?
+  if ( ! check_valid(*g, label) ) return g->Union();
+  else return std::auto_ptr<Geometry>(g->clone());
 }
 
 



More information about the geos-commits mailing list