1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Use, modification and distribution is subject to the Boost Software License,
5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #include <algorithms/test_convert.hpp>
11 template <typename Point1
, typename Point2
>
12 void test_mixed_point_types()
14 test_mixed_identical_result
16 bg::model::multi_point
<Point1
>,
17 bg::model::multi_point
<Point2
>
19 ("MULTIPOINT((1 1),(2 2),(3 3))");
21 test_mixed_identical_result
23 bg::model::multi_linestring
<bg::model::linestring
<Point1
> >,
24 bg::model::multi_linestring
<bg::model::linestring
<Point2
> >
26 ("MULTILINESTRING((1 1,2 2),(3 3,4 4))");
28 // Single -> multi (always possible)
31 Point1
, bg::model::multi_point
<Point2
>
40 bg::model::linestring
<Point1
>,
41 bg::model::multi_linestring
<bg::model::linestring
<Point2
> >
44 "LINESTRING(1 1,2 2)",
45 "MULTILINESTRING((1 1,2 2))",
50 bg::model::segment
<Point1
>,
51 bg::model::multi_linestring
<bg::model::linestring
<Point2
> >
54 "LINESTRING(1 1,2 2)",
55 "MULTILINESTRING((1 1,2 2))",
60 bg::model::box
<Point1
>,
61 bg::model::multi_polygon
<bg::model::polygon
<Point2
> >
65 "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))",
70 bg::model::ring
<Point1
, true>,
71 bg::model::multi_polygon
<bg::model::polygon
<Point2
, false> >
74 "POLYGON((0 0,0 1,1 1,1 0,0 0))",
75 "MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))",
79 // Multi -> single: should not compile (because multi often have 0 or >1 elements)
82 template <typename Point1
, typename Point2
>
83 void test_mixed_types()
85 test_mixed_point_types
<Point1
, Point2
>();
86 test_mixed_point_types
<Point2
, Point1
>();
89 int test_main( int , char* [] )
93 bg::model::point
<int, 2, bg::cs::cartesian
>,
94 bg::model::point
<double, 2, bg::cs::cartesian
>