1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014-2015, Oracle and/or its affiliates.
5 // Licensed under the Boost Software License version 1.0.
6 // http://www.boost.org/users/license.html
8 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12 #ifndef BOOST_TEST_MODULE
13 #define BOOST_TEST_MODULE test_intersection_pointlike_pointlike
16 #ifdef BOOST_GEOMETRY_TEST_DEBUG
17 #define BOOST_GEOMETRY_DEBUG_TURNS
18 #define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER
21 #include <boost/test/included/unit_test.hpp>
23 #include "../test_set_ops_pointlike.hpp"
25 #include <boost/geometry/geometries/multi_point.hpp>
27 typedef bg::model::point
<double,2,bg::cs::cartesian
> point_type
;
28 typedef bg::model::multi_point
<point_type
> multi_point_type
;
32 //===========================================================================
33 //===========================================================================
34 //===========================================================================
37 BOOST_AUTO_TEST_CASE( test_intersection_point_point
)
39 #ifdef BOOST_GEOMETRY_TEST_DEBUG
40 std::cout
<< std::endl
<< std::endl
<< std::endl
;
41 std::cout
<< "*** POINT / POINT INTERSECTION ***" << std::endl
;
42 std::cout
<< std::endl
;
46 typedef multi_point_type MP
;
48 typedef test_set_op_of_pointlike_geometries
50 P
, P
, MP
, bg::overlay_intersection
55 from_wkt
<P
>("POINT(0 0)"),
56 from_wkt
<P
>("POINT(1 1)"),
57 from_wkt
<MP
>("MULTIPOINT()")
62 from_wkt
<P
>("POINT(0 0)"),
63 from_wkt
<P
>("POINT(0 0)"),
64 from_wkt
<MP
>("MULTIPOINT(0 0)")
69 BOOST_AUTO_TEST_CASE( test_intersection_multipoint_point
)
71 #ifdef BOOST_GEOMETRY_TEST_DEBUG
72 std::cout
<< std::endl
<< std::endl
<< std::endl
;
73 std::cout
<< "*** MULTIPOINT / POINT INTERSECTION ***" << std::endl
;
74 std::cout
<< std::endl
;
78 typedef multi_point_type MP
;
80 typedef test_set_op_of_pointlike_geometries
82 MP
, P
, MP
, bg::overlay_intersection
87 from_wkt
<MP
>("MULTIPOINT(0 0)"),
88 from_wkt
<P
>("POINT(1 1)"),
89 from_wkt
<MP
>("MULTIPOINT()")
94 from_wkt
<MP
>("MULTIPOINT(0 0)"),
95 from_wkt
<P
>("POINT(0 0)"),
96 from_wkt
<MP
>("MULTIPOINT(0 0)")
101 from_wkt
<MP
>("MULTIPOINT(0 0,0 0)"),
102 from_wkt
<P
>("POINT(1 1)"),
103 from_wkt
<MP
>("MULTIPOINT()")
108 from_wkt
<MP
>("MULTIPOINT(0 0,0 0)"),
109 from_wkt
<P
>("POINT(0 0)"),
110 from_wkt
<MP
>("MULTIPOINT(0 0)")
115 from_wkt
<MP
>("MULTIPOINT(0 0,0 0,1 0)"),
116 from_wkt
<P
>("POINT(1 1)"),
117 from_wkt
<MP
>("MULTIPOINT()")
122 from_wkt
<MP
>("MULTIPOINT(0 0,0 0,1 0)"),
123 from_wkt
<P
>("POINT(1 0)"),
124 from_wkt
<MP
>("MULTIPOINT(1 0)")
129 from_wkt
<MP
>("MULTIPOINT(0 0,0 0,1 0)"),
130 from_wkt
<P
>("POINT(0 0)"),
131 from_wkt
<MP
>("MULTIPOINT(0 0)")
136 from_wkt
<MP
>("MULTIPOINT()"),
137 from_wkt
<P
>("POINT(0 0)"),
138 from_wkt
<MP
>("MULTIPOINT()")
143 BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multipoint
)
145 #ifdef BOOST_GEOMETRY_TEST_DEBUG
146 std::cout
<< std::endl
<< std::endl
<< std::endl
;
147 std::cout
<< "*** MULTIPOINT / MULTIPOINT INTERSECTION ***" << std::endl
;
148 std::cout
<< std::endl
;
151 typedef multi_point_type MP
;
153 typedef test_set_op_of_pointlike_geometries
155 MP
, MP
, MP
, bg::overlay_intersection
160 from_wkt
<MP
>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
161 from_wkt
<MP
>("MULTIPOINT(1 0,1 1,1 1,1 1)"),
162 from_wkt
<MP
>("MULTIPOINT(1 0,1 1,1 1,1 1)")
167 from_wkt
<MP
>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
168 from_wkt
<MP
>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
169 from_wkt
<MP
>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
170 from_wkt
<MP
>("MULTIPOINT(1 0,0 0,1 1,0 0)")
175 from_wkt
<MP
>("MULTIPOINT()"),
176 from_wkt
<MP
>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
177 from_wkt
<MP
>("MULTIPOINT()")
182 from_wkt
<MP
>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
183 from_wkt
<MP
>("MULTIPOINT()"),
184 from_wkt
<MP
>("MULTIPOINT()")
189 from_wkt
<MP
>("MULTIPOINT()"),
190 from_wkt
<MP
>("MULTIPOINT()"),
191 from_wkt
<MP
>("MULTIPOINT()")
196 from_wkt
<MP
>("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"),
197 from_wkt
<MP
>("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"),
198 from_wkt
<MP
>("MULTIPOINT(1 0,0 0,2 0)")