]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/relational_operations/covered_by/covered_by_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/algorithms/correct.hpp>
11 #include <boost/geometry/algorithms/covered_by.hpp>
13 #include <boost/geometry/geometries/box.hpp>
15 #include <boost/geometry/core/point_order.hpp>
17 #include <boost/geometry/geometries/point_xy.hpp>
18 #include <boost/geometry/geometries/multi_polygon.hpp>
20 #include <boost/geometry/io/wkt/wkt.hpp>
22 #include "test_covered_by.hpp"
28 typedef bg::model::multi_polygon
<bg::model::polygon
<P
> > mp
;
30 // test multi-with-one-polygon (trivial case)
31 test_geometry
<P
, mp
>("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true);
32 test_geometry
<P
, mp
>("POINT(3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false);
33 test_geometry
<P
, mp
>("POINT(0 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true);
34 test_geometry
<P
, mp
>("POINT(4 4)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false);
36 // test if it is in one of them
37 std::string
multi("MULTIPOLYGON("
38 "((0 0,0 2,2 2,2 0,0 0))"
39 "((3 3,3 6,6 6,6 3,3 3))"
41 test_geometry
<P
, mp
>("POINT(4 4)", multi
, true);
42 test_geometry
<P
, mp
>("POINT(1 1)", multi
, true);
43 test_geometry
<P
, mp
>("POINT(0 1)", multi
, true);
46 int test_main( int , char* [] )
48 //test_all<bg::model::d2::point_xy<int> >();
49 test_all
<bg::model::d2::point_xy
<double> >();
51 #if defined(HAVE_TTMATH)
52 test_all
<bg::model::d2::point_xy
<ttmath_big
> >();