Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/geometry/strategies/transform/srs_transformer.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2017.
0006 // Modifications copyright (c) 2017, Oracle and/or its affiliates.
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Use, modification and distribution is subject to the Boost Software License,
0010 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0011 // http://www.boost.org/LICENSE_1_0.txt)
0012 
0013 #ifndef BOOST_GEOMETRY_STRATEGIES_TRANSFORM_SRS_TRANSFORMER_HPP
0014 #define BOOST_GEOMETRY_STRATEGIES_TRANSFORM_SRS_TRANSFORMER_HPP
0015 
0016 
0017 namespace boost { namespace geometry
0018 {
0019 
0020 namespace strategy { namespace transform
0021 {
0022 
0023 /*!
0024     \brief Transformation strategy to do transform using a forward
0025            Map Projection or SRS transformation.
0026     \ingroup transform
0027     \tparam ProjectionOrTransformation SRS projection or transformation type
0028  */
0029 template
0030 <
0031     typename ProjectionOrTransformation
0032 >
0033 class srs_forward_transformer
0034 {
0035 public:
0036     inline srs_forward_transformer()
0037     {}
0038 
0039     template <typename Parameters>
0040     inline srs_forward_transformer(Parameters const& parameters)
0041         : m_proj_or_transform(parameters)
0042     {}
0043 
0044     template <typename Parameters1, typename Parameters2>
0045     inline srs_forward_transformer(Parameters1 const& parameters1, Parameters2 const& parameters2)
0046         : m_proj_or_transform(parameters1, parameters2)
0047     {}
0048 
0049     template <typename Geometry1, typename Geometry2>
0050     inline bool apply(Geometry1 const& g1, Geometry2 & g2) const
0051     {
0052         return m_proj_or_transform.forward(g1, g2);
0053     }
0054 
0055 private:
0056     ProjectionOrTransformation m_proj_or_transform;
0057 };
0058 
0059 
0060 /*!
0061     \brief Transformation strategy to do transform using an inverse
0062            Map Projection or SRS transformation.
0063     \ingroup transform
0064     \tparam ProjectionOrTransformation SRS projection or transformation type
0065  */
0066 template
0067 <
0068     typename ProjectionOrTransformation
0069 >
0070 class srs_inverse_transformer
0071 {
0072 public:
0073     inline srs_inverse_transformer()
0074     {}
0075 
0076     template <typename Parameters>
0077     inline srs_inverse_transformer(Parameters const& parameters)
0078         : m_proj_or_transform(parameters)
0079     {}
0080 
0081     template <typename Parameters1, typename Parameters2>
0082     inline srs_inverse_transformer(Parameters1 const& parameters1, Parameters2 const& parameters2)
0083         : m_proj_or_transform(parameters1, parameters2)
0084     {}
0085 
0086     template <typename Geometry1, typename Geometry2>
0087     inline bool apply(Geometry1 const& g1, Geometry2 & g2) const
0088     {
0089         return m_proj_or_transform.inverse(g1, g2);
0090     }
0091 
0092 private:
0093     ProjectionOrTransformation m_proj_or_transform;
0094 };
0095 
0096 
0097 }} // namespace strategy::transform
0098 
0099 }} // namespace boost::geometry
0100 
0101 
0102 #endif // BOOST_GEOMETRY_STRATEGIES_TRANSFORM_SRS_TRANSFORMER_HPP