]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/area/area_multi.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
5 // This file was modified by Oracle on 2015, 2016.
6 // Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
8 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
15 #include <algorithms/area/test_area.hpp>
17 #include <boost/geometry/geometries/geometries.hpp>
18 #include <boost/geometry/geometries/point_xy.hpp>
19 #include <boost/geometry/geometries/multi_polygon.hpp>
21 #include <boost/geometry/io/wkt/wkt.hpp>
26 template <typename CT
>
29 typedef typename
bg::model::d2::point_xy
<CT
> pt_crt
;
30 typedef typename
bg::model::point
<CT
, 2, bg::cs::spherical_equatorial
<bg::degree
> > pt_sph
;
31 typedef typename
bg::model::point
<CT
, 2, bg::cs::geographic
<bg::degree
> > pt_geo
;
33 typedef bg::model::multi_polygon
<bg::model::polygon
<pt_crt
> > mp_crt
;
34 typedef bg::model::multi_polygon
<bg::model::polygon
<pt_sph
> > mp_sph
;
35 typedef bg::model::multi_polygon
<bg::model::polygon
<pt_geo
> > mp_geo
;
37 // mean Earth's radius^2
38 double r2
= bg::math::sqr(bg::get_radius
<0>(bg::srs::sphere
<double>()));
40 std::string poly
= "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))";
41 test_geometry
<mp_crt
>(poly
, 16.0);
42 test_geometry
<mp_sph
>(poly
, 197897454752.69489 / r2
);
43 test_geometry
<mp_geo
>(poly
, 197018888665.8331);
46 int test_main( int , char* [] )