epsg.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Boost.Geometry
  2. // Copyright (c) 2017, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  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)
  7. #ifndef BOOST_GEOMETRY_SRS_EPSG_HPP
  8. #define BOOST_GEOMETRY_SRS_EPSG_HPP
  9. #include <boost/geometry/srs/projection.hpp>
  10. #include <boost/geometry/srs/projections/epsg.hpp>
  11. #include <boost/geometry/srs/projections/epsg_params.hpp>
  12. #include <boost/geometry/srs/projections/epsg_traits.hpp>
  13. namespace boost { namespace geometry
  14. {
  15. namespace projections
  16. {
  17. template <typename CT>
  18. struct dynamic_parameters<srs::epsg, CT>
  19. {
  20. static inline projections::parameters<CT> apply(srs::epsg const& params)
  21. {
  22. return projections::detail::pj_init_plus<CT>(
  23. srs::dynamic(),
  24. projections::detail::epsg_to_string(params.code),
  25. false);
  26. }
  27. };
  28. template <int Code, typename CT>
  29. class proj_wrapper<srs::static_epsg<Code>, CT>
  30. : public static_proj_wrapper_base
  31. <
  32. typename projections::detail::epsg_traits<Code>::static_parameters_type,
  33. CT
  34. >
  35. {
  36. typedef projections::detail::epsg_traits<Code> epsg_traits;
  37. typedef typename epsg_traits::static_parameters_type static_parameters_type;
  38. typedef static_proj_wrapper_base<static_parameters_type, CT> base_t;
  39. public:
  40. proj_wrapper()
  41. : base_t(epsg_traits::s_par(), epsg_traits::par())
  42. {}
  43. };
  44. } // namespace projections
  45. namespace srs
  46. {
  47. template <int Code, typename CT>
  48. class projection<srs::static_epsg<Code>, CT>
  49. : public projections::projection<srs::static_epsg<Code>, CT>
  50. {
  51. typedef projections::projection<srs::static_epsg<Code>, CT> base_t;
  52. public:
  53. projection()
  54. {}
  55. };
  56. } // namespace srs
  57. }} // namespace boost::geometry
  58. #endif // BOOST_GEOMETRY_SRS_EPSG_HPP