[geos-commits] r3621 - in trunk: capi tests/xmltester
svn_geos at osgeo.org
svn_geos at osgeo.org
Tue May 8 13:39:22 EDT 2012
Author: strk
Date: 2012-05-08 10:39:21 -0700 (Tue, 08 May 2012)
New Revision: 3621
Modified:
trunk/capi/geos_ts_c.cpp
trunk/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: trunk/capi/geos_ts_c.cpp
===================================================================
--- trunk/capi/geos_ts_c.cpp 2012-05-08 17:35:15 UTC (rev 3620)
+++ trunk/capi/geos_ts_c.cpp 2012-05-08 17:39:21 UTC (rev 3621)
@@ -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: trunk/tests/xmltester/XMLTester.cpp
===================================================================
--- trunk/tests/xmltester/XMLTester.cpp 2012-05-08 17:35:15 UTC (rev 3620)
+++ trunk/tests/xmltester/XMLTester.cpp 2012-05-08 17:39:21 UTC (rev 3621)
@@ -73,11 +73,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