]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/within/within_multi.cpp
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 <geometry_test_common.hpp>
10 #include <boost/geometry/io/wkt/wkt.hpp>
12 #include <boost/geometry/algorithms/correct.hpp>
13 #include <boost/geometry/algorithms/within.hpp>
15 #include <boost/geometry/geometries/box.hpp>
16 #include <boost/geometry/geometries/polygon.hpp>
17 #include <boost/geometry/geometries/point_xy.hpp>
18 #include <boost/geometry/geometries/multi_polygon.hpp>
20 #include "test_within.hpp"
26 typedef bg::model::multi_polygon
<bg::model::polygon
<P
> > mp
;
28 // test multi-with-one-polygon (trivial case)
29 test_geometry
<P
, mp
>("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true);
30 test_geometry
<P
, mp
>("POINT(3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false);
31 test_geometry
<P
, mp
>("POINT(0 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false);
32 test_geometry
<P
, mp
>("POINT(4 4)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false);
34 // test if it is in one of them
35 std::string
multi("MULTIPOLYGON("
36 "((0 0,0 2,2 2,2 0,0 0))"
37 "((3 3,3 6,6 6,6 3,3 3))"
39 test_geometry
<P
, mp
>("POINT(4 4)", multi
, true);
40 test_geometry
<P
, mp
>("POINT(1 1)", multi
, true);
41 test_geometry
<P
, mp
>("POINT(0 1)", multi
, false);
44 int test_main( int , char* [] )
46 //test_all<bg::model::d2::point_xy<int> >();
47 test_all
<bg::model::d2::point_xy
<double> >();