Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75119 - in trunk/libs/geometry/test/multi/algorithms: . overlay
From: barend.gehrels_at_[hidden]
Date: 2011-10-25 16:11:29


Author: barendgehrels
Date: 2011-10-25 16:11:28 EDT (Tue, 25 Oct 2011)
New Revision: 75119
URL: http://svn.boost.org/trac/boost/changeset/75119

Log:
Fixed order-problem by avoiding argument reversion. See correspondence on GGL mailing list 2011/10/25 --> added testcases for the other case described as "Say the MP is the 2 squares below and P is the blue-ish rectangle."
Text files modified:
   trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp | 22 ++++++++++++++++++++++
   trunk/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp | 7 +++++++
   2 files changed, 29 insertions(+), 0 deletions(-)

Modified: trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp (original)
+++ trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp 2011-10-25 16:11:28 EDT (Tue, 25 Oct 2011)
@@ -96,6 +96,28 @@
         ggl_list_20111025_vd[2], ggl_list_20111025_vd[3],
             1, -999, 8.0, 1, -999, 12.5);
 
+ // Second case
+ // This can be tested with this SQL for SQL-Server
+ /*
+ with viewy as (select geometry::STGeomFromText(
+ 'POLYGON((5 0,5 4,8 4,8 0,5 0))',0) as p,
+ geometry::STGeomFromText(
+ 'MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((4 0,4 2,6 2,6 0,4 0)))',0) as q)
+ select
+ p.STDifference(q).STArea(),p.STDifference(q).STNumGeometries(),p.STDifference(q) as p_min_q,
+ q.STDifference(p).STArea(),q.STDifference(p).STNumGeometries(),q.STDifference(p) as q_min_p,
+ p.STSymDifference(q).STArea(),q.STSymDifference(p) as p_xor_q
+ from viewy
+
+ Outputting:
+ 10, 1, <WKB>, 6, 2, <WKB>, 16, <WKB>
+ */
+
+ test_one<Polygon, Polygon, MultiPolygon>("ggl_list_20111025_vd_2",
+ ggl_list_20111025_vd_2[0], ggl_list_20111025_vd_2[1],
+ 1, -999, 10.0, 2, -999, 6.0);
+
+
     /* TODO: fix
     test_one<Polygon, MultiPolygon, MultiPolygon>("case_101_multi",
         case_101_multi[0], case_101_multi[1],

Modified: trunk/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp (original)
+++ trunk/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp 2011-10-25 16:11:28 EDT (Tue, 25 Oct 2011)
@@ -418,6 +418,13 @@
     "MULTIPOLYGON(((0 0,0 4,4 0,0 0)))",
     "MULTIPOLYGON(((10 0,10 5,15 0,10 0)))"
     };
+
+// Same, mail with other case with text "Say the MP is the 2 squares below and P is the blue-ish rectangle."
+static std::string ggl_list_20111025_vd_2[2] =
+ {
+ "POLYGON((5 0,5 4,8 4,8 0,5 0))",
+ "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((4 0,4 2,6 2,6 0,4 0)))"
+ };
     
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk