// Boost.Geometry // Copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_PAR4_HPP #define BOOST_GEOMETRY_SRS_PROJECTIONS_PAR4_HPP #include #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { namespace srs { namespace par4 { // proj // defined in projections' implementation files // ellps struct MERIT {}; struct SGS85 {}; struct GRS80 {}; struct IAU76 {}; struct airy {}; struct APL4_9 {}; struct NWL9D {}; struct mod_airy {}; struct andrae {}; struct aust_SA {}; struct GRS67 {}; struct bessel {}; struct bess_nam {}; struct clrk66 {}; struct clrk80 {}; struct clrk80ign {}; struct CPM {}; struct delmbr {}; struct engelis {}; struct evrst30 {}; struct evrst48 {}; struct evrst56 {}; struct evrst69 {}; struct evrstSS {}; struct fschr60 {}; struct fschr60m {}; struct fschr68 {}; struct helmert {}; struct hough {}; struct intl {}; struct krass {}; struct kaula {}; struct lerch {}; struct mprts {}; struct new_intl {}; struct plessis {}; struct SEasia {}; struct walbeck {}; struct WGS60 {}; struct WGS66 {}; struct WGS72 {}; struct WGS84 {}; struct sphere {}; // datum //struct WGS84 {}; // already defined above struct GGRS87 {}; struct NAD83 {}; struct NAD27 {}; struct potsdam {}; struct carthage {}; struct hermannskogel {}; struct ire65 {}; struct nzgd49 {}; struct OSGB36 {}; template struct proj { typedef P type; }; #ifndef DOXYGEN_NO_DETAIL namespace detail { template < typename E, typename Tag = typename geometry::tag::type > struct ellps_impl : private E // empty base optimization { typedef E type; ellps_impl() : E() {} explicit ellps_impl(E const& e) : E(e) {} E const& model() const { return *this; } }; template struct ellps_impl { typedef E type; }; } // namespace detail #endif // DOXYGEN_NO_DETAIL template struct ellps : par4::detail::ellps_impl { ellps() {} explicit ellps(E const& e) : par4::detail::ellps_impl(e) {} }; template struct datum { typedef D type; }; template struct o_proj { typedef P type; }; struct guam {}; #ifndef DOXYGEN_NO_DETAIL namespace detail { inline double b_from_a_rf(double a, double rf) { return a * (1.0 - 1.0 / rf); } template < typename Ellps, typename Tag = typename geometry::tag::type > struct ellps_traits { typedef typename Ellps::type model_type; static model_type model(Ellps const& e) { return e.model(); } }; #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B(NAME, A, B) \ template <> \ struct ellps_traits, void> \ { \ typedef srs::spheroid model_type; \ static model_type model(ellps const&) { return model_type(A, B); } \ }; #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(NAME, A, RF) \ template <> \ struct ellps_traits, void> \ { \ typedef srs::spheroid model_type; \ static model_type model(ellps const&) { return model_type(A, b_from_a_rf(A, RF)); } \ }; #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SPHERE(NAME, R) \ template <> \ struct ellps_traits, void> \ { \ typedef srs::sphere model_type; \ static model_type model(ellps const&) { return model_type(R); } \ }; BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(MERIT, 6378137.0, 298.257) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(SGS85, 6378136.0, 298.257) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(GRS80, 6378137.0, 298.257222101) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(IAU76, 6378140.0, 298.257) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (airy, 6377563.396, 6356256.910) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(APL4_9, 6378137.0, 298.25) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(NWL9D, 6378145.0, 298.25) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (mod_airy, 6377340.189, 6356034.446) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(andrae, 6377104.43, 300.0) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(aust_SA, 6378160.0, 298.25) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(GRS67, 6378160.0, 298.2471674270) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(bessel, 6377397.155, 299.1528128) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(bess_nam, 6377483.865, 299.1528128) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (clrk66, 6378206.4, 6356583.8) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(clrk80, 6378249.145, 293.4663) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(clrk80ign, 6378249.2, 293.4660212936269) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(CPM, 6375738.7, 334.29) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(delmbr, 6376428.0, 311.5) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(engelis, 6378136.05, 298.2566) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(evrst30, 6377276.345, 300.8017) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(evrst48, 6377304.063, 300.8017) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(evrst56, 6377301.243, 300.8017) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(evrst69, 6377295.664, 300.8017) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(evrstSS, 6377298.556, 300.8017) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(fschr60, 6378166.0, 298.3) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(fschr60m, 6378155.0, 298.3) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(fschr68, 6378150.0, 298.3) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(helmert, 6378200.0, 298.3) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(hough, 6378270.0, 297.0) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(intl, 6378388.0, 297.0) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(krass, 6378245.0, 298.3) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(kaula, 6378163.0, 298.24) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(lerch, 6378139.0, 298.257) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(mprts, 6397300.0, 191.0) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (new_intl, 6378157.5, 6356772.2) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (plessis, 6376523.0, 6355863.0) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (SEasia, 6378155.0, 6356773.3205) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_B (walbeck, 6376896.0, 6355834.8467) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(WGS60, 6378165.0, 298.3) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(WGS66, 6378145.0, 298.25) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(WGS72, 6378135.0, 298.26) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS_A_RF(WGS84, 6378137.0, 298.257223563) BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SPHERE (sphere, 6370997.0) template struct datum_traits { typedef void ellps_type; static std::string id() { return ""; } static std::string def_n() { return ""; } static std::string def_v() { return ""; } }; #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(NAME, ID, ELLPS, DEF_N, DEF_V) \ template <> \ struct datum_traits< datum > \ { \ typedef par4::ellps ellps_type; \ static std::string id() { return ID; } \ static std::string def_n() { return DEF_N; } \ static std::string def_v() { return DEF_V; } \ }; BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(WGS84, "WGS84", WGS84, "towgs84", "0,0,0") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(GGRS87, "GGRS87", GRS80, "towgs84", "-199.87,74.79,246.62") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(NAD83, "NAD83", GRS80, "towgs84", "0,0,0") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(NAD27, "NAD27", clrk66, "nadgrids", "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(potsdam, "potsdam", bessel, "towgs84", "598.1,73.7,418.2,0.202,0.045,-2.455,6.7") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(carthage, "carthage", clrk80ign, "towgs84", "-263.0,6.0,431.0") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(hermannskogel, "hermannskogel", bessel, "towgs84", "577.326,90.129,463.919,5.137,1.474,5.297,2.4232") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(ire65, "ire65", mod_airy, "towgs84", "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(nzgd49, "nzgd49", intl, "towgs84", "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993") BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(OSGB36, "OSGB36", airy, "towgs84", "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894") template < typename Tuple, template class IsSamePred, int I = 0, int N = boost::tuples::length::value > struct tuples_find_index_if : boost::mpl::if_c < IsSamePred::type>::value, boost::integral_constant, typename tuples_find_index_if::type >::type {}; template < typename Tuple, template class IsSamePred, int N > struct tuples_find_index_if : boost::integral_constant {}; template < typename Tuple, template class IsSamePred, int I = tuples_find_index_if::value, int N = boost::tuples::length::value > struct tuples_find_if : boost::tuples::element {}; template < typename Tuple, template class IsSamePred, int N > struct tuples_find_if { typedef void type; }; /*template struct is_param { template struct is_same_impl : boost::false_type {}; template struct is_same_impl : boost::true_type {}; template struct is_same : is_same_impl {}; }; template