epsg.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Boost.Geometry
  2. // Copyright (c) 2017-2018, 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 <>
  18. struct dynamic_parameters<srs::epsg>
  19. {
  20. static const bool is_specialized = true;
  21. static inline srs::dpar::parameters<> apply(srs::epsg const& params)
  22. {
  23. return projections::detail::epsg_to_parameters(params.code);
  24. }
  25. };
  26. template <int Code, typename CT>
  27. class proj_wrapper<srs::static_epsg<Code>, CT>
  28. : public proj_wrapper
  29. <
  30. typename projections::detail::epsg_traits<Code>::parameters_type,
  31. CT
  32. >
  33. {
  34. typedef projections::detail::epsg_traits<Code> epsg_traits;
  35. typedef proj_wrapper
  36. <
  37. typename epsg_traits::parameters_type,
  38. CT
  39. > base_t;
  40. public:
  41. proj_wrapper()
  42. : base_t(epsg_traits::parameters())
  43. {}
  44. explicit proj_wrapper(srs::static_epsg<Code> const&)
  45. : base_t(epsg_traits::parameters())
  46. {}
  47. };
  48. } // namespace projections
  49. }} // namespace boost::geometry
  50. #endif // BOOST_GEOMETRY_SRS_EPSG_HPP