[geos-commits] r3620 - in branches/3.3: . capi tests/xmltester

svn_geos at osgeo.org svn_geos at osgeo.org
Tue May 8 13:35:15 EDT 2012


Author: strk
Date: 2012-05-08 10:35:15 -0700 (Tue, 08 May 2012)
New Revision: 3620

Modified:
   branches/3.3/NEWS
   branches/3.3/capi/geos_ts_c.cpp
   branches/3.3/tests/xmltester/XMLTester.cpp
Log:
Geometry methods do use BinaryOp internally + shortcuts (#542)

This commit changes both XMLTester and C-API to not use BinaryOp
directly but rather rely on geometry methods to do that.

Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS	2012-05-04 14:51:02 UTC (rev 3619)
+++ branches/3.3/NEWS	2012-05-08 17:35:15 UTC (rev 3620)
@@ -5,6 +5,7 @@
     - Do not abort on NaN overlay input (#530)
     - Reduce CommonBitsRemover harmful effects during overlay op (#527)
     - Better cross-compiler support (#534)
+    - Enable overlay ops short-circuits (#542)
 
 Changes in 3.3.3
 2012-04-01

Modified: branches/3.3/capi/geos_ts_c.cpp
===================================================================
--- branches/3.3/capi/geos_ts_c.cpp	2012-05-04 14:51:02 UTC (rev 3619)
+++ branches/3.3/capi/geos_ts_c.cpp	2012-05-08 17:35:15 UTC (rev 3620)
@@ -50,6 +50,7 @@
 #include <geos/operation/polygonize/Polygonizer.h>
 #include <geos/operation/linemerge/LineMerger.h>
 #include <geos/operation/overlay/OverlayOp.h>
+#include <geos/operation/overlay/snap/GeometrySnapper.h>
 #include <geos/operation/union/CascadedPolygonUnion.h>
 #include <geos/operation/buffer/BufferOp.h>
 #include <geos/operation/buffer/BufferParameters.h>
@@ -57,7 +58,6 @@
 #include <geos/operation/relate/RelateOp.h>
 #include <geos/operation/sharedpaths/SharedPathsOp.h>
 #include <geos/linearref/LengthIndexedLine.h>
-#include <geos/geom/BinaryOp.h>
 #include <geos/util/IllegalArgumentException.h>
 #include <geos/util/UniqueCoordinateArrayFilter.h>
 #include <geos/util/Machine.h>
@@ -1605,12 +1605,7 @@
 
     try
     {
-        GeomAutoPtr g3(BinaryOp(g1, g2, overlayOp(OverlayOp::opINTERSECTION)));
-        return g3.release();
-
-        // XXX: old version
-        //Geometry *g3 = g1->intersection(g2);
-        //return g3;
+        return g1->intersection(g2);
     }
     catch (const std::exception &e)
     {
@@ -1850,12 +1845,7 @@
 
     try
     {
-        GeomAutoPtr g3(BinaryOp(g1, g2, overlayOp(OverlayOp::opDIFFERENCE)));
-        return g3.release();
-
-        // XXX: old version
-        //Geometry *g3 = g1->difference(g2);
-        //return g3;
+        return g1->difference(g2);
     }
     catch (const std::exception &e)
     {
@@ -1918,10 +1908,7 @@
 
     try
     {
-        GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opSYMDIFFERENCE));
-        return g3.release();
-        //Geometry *g3 = g1->symDifference(g2);
-        //return g3;
+        return g1->symDifference(g2);
     }
     catch (const std::exception &e)
     {
@@ -1953,12 +1940,7 @@
 
     try
     {
-        GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opUNION));
-        return g3.release();
-
-        // XXX: old version
-        //Geometry *g3 = g1->Union(g2);
-        //return g3;
+        return g1->Union(g2);
     }
     catch (const std::exception &e)
     {

Modified: branches/3.3/tests/xmltester/XMLTester.cpp
===================================================================
--- branches/3.3/tests/xmltester/XMLTester.cpp	2012-05-04 14:51:02 UTC (rev 3619)
+++ branches/3.3/tests/xmltester/XMLTester.cpp	2012-05-08 17:35:15 UTC (rev 3620)
@@ -74,11 +74,8 @@
 #include "Stackwalker.h"
 #endif
 
-// Undefine this to use Geometry methods for overlay operations
-//
-// Using BinaryOp gives more successes though...
-//
-#define USE_BINARYOP 1
+// Geometry methods do use BinaryOp internally
+#undef USE_BINARYOP
 
 using namespace geos;
 using namespace geos::operation::polygonize;



More information about the geos-commits mailing list