]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/srs/projection.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
8 // This file was modified by Oracle on 2017, 2018.
9 // Modifications copyright (c) 2017-2018, Oracle and/or its affiliates.
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
13 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
15 // Use, modification and distribution is subject to the Boost Software License,
16 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
21 #pragma warning( disable : 4305 ) // truncation double -> float
22 #endif // defined(_MSC_VER)
25 #define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE
27 #include <geometry_test_common.hpp>
29 #include <boost/geometry/srs/projection.hpp>
31 #include <boost/geometry/algorithms/transform.hpp>
32 #include <boost/geometry/core/coordinate_type.hpp>
34 #include <boost/geometry/geometries/geometries.hpp>
35 #include <boost/geometry/geometries/point_xy.hpp>
36 #include <boost/geometry/geometries/adapted/c_array.hpp>
37 #include <test_common/test_point.hpp>
40 namespace srs
= bg::srs
;
42 template <typename P1
, typename P2
, typename Params
>
43 void test_one(double lon
, double lat
,
44 typename
bg::coordinate_type
<P2
>::type x
,
45 typename
bg::coordinate_type
<P2
>::type y
,
48 // hybrid interface disabled by default
49 // static_proj4 default ctor, dynamic parameters passed
50 srs::projection
<Params
> prj(params
);
59 BOOST_CHECK_CLOSE(bg::get
<0>(xy
), x
, 0.001);
60 BOOST_CHECK_CLOSE(bg::get
<1>(xy
), y
, 0.001);
66 typedef typename
bg::coordinate_type
<P
>::type coord_type
;
67 typedef bg::model::point
<coord_type
, 2, bg::cs::geographic
<bg::degree
> > point_type
;
69 using namespace srs::spar
;
72 test_one
<point_type
, P
>
73 (4.897000, 52.371000, 334609.583974, 5218502.503686,
74 parameters
<proj_aea
, ellps_wgs84
, units_m
, lat_1
<>, lat_2
<> >(
75 proj_aea(), ellps_wgs84(), units_m(), lat_1
<>(55), lat_2
<>(65)));
78 BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(bg::cs::cartesian
)
80 int test_main(int, char* [])
84 test_all
<double[2]>();
87 //test_all<test::test_point>();
89 //test_all<bg::model::d2::point_xy<int> >();
90 test_all
<bg::model::d2::point_xy
<float> >();
91 test_all
<bg::model::d2::point_xy
<double> >();
92 test_all
<bg::model::d2::point_xy
<long double> >();