Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75689 - in trunk/libs/geometry/test: algorithms multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-11-27 07:07:35


Author: barendgehrels
Date: 2011-11-27 07:07:34 EST (Sun, 27 Nov 2011)
New Revision: 75689
URL: http://svn.boost.org/trac/boost/changeset/75689

Log:
Linestring/polygon overlay, unit tests for phase 9
Text files modified:
   trunk/libs/geometry/test/algorithms/test_difference.hpp | 1 +
   trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp | 15 +++++++++++++++
   2 files changed, 16 insertions(+), 0 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/test_difference.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_difference.hpp (original)
+++ trunk/libs/geometry/test/algorithms/test_difference.hpp 2011-11-27 07:07:34 EST (Sun, 27 Nov 2011)
@@ -22,6 +22,7 @@
 #include <boost/geometry/algorithms/sym_difference.hpp>
 
 #include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/length.hpp>
 #include <boost/geometry/algorithms/num_points.hpp>
 
 #include <boost/geometry/geometries/geometries.hpp>

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-11-27 07:07:34 EST (Sun, 27 Nov 2011)
@@ -143,6 +143,20 @@
 */
 }
 
+template <typename MultiPolygon, typename MultiLineString>
+void test_areal_linear()
+{
+ typedef typename boost::range_value<MultiPolygon>::type Polygon;
+ typedef typename boost::range_value<MultiLineString>::type LineString;
+ typedef typename bg::point_type<Polygon>::type Point;
+ typedef bg::model::ring<Point> Ring;
+
+ test_one_lp<LineString, LineString, MultiPolygon>("case_mp_ls_1", "LINESTRING(2 0,2 5)", case_multi_simplex[0], 3, 5, 1.30);
+ test_one_lp<LineString, MultiLineString, Polygon>("case_p_mls_1", "MULTILINESTRING((2 0,2 5),(3 0,3 5))", case_single_simplex, 3, 6, 2.5);
+ test_one_lp<LineString, MultiLineString, MultiPolygon>("case_mp_mls_1", "MULTILINESTRING((2 0,2 5),(3 0,3 5))", case_multi_simplex[0], 6, 11, 3.1666667);
+ test_one_lp<LineString, MultiLineString, Ring>("case_r_mls_1", "MULTILINESTRING((2 0,2 5),(3 0,3 5))", case_single_simplex, 3, 6, 2.5);
+}
+
 
 template <typename P>
 void test_all()
@@ -152,6 +166,7 @@
     typedef bg::model::polygon<P> polygon;
     typedef bg::model::multi_polygon<polygon> multi_polygon;
     test_areal<ring, polygon, multi_polygon>();
+ test_areal_linear<multi_polygon, bg::model::multi_linestring<bg::model::linestring<P> > >();
 }
 
 


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