invalid_point.hpp 987 B

1234567891011121314151617181920212223242526272829303132333435363738
  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_PROJECTIONS_INVALID_POINT_HPP
  8. #define BOOST_GEOMETRY_PROJECTIONS_INVALID_POINT_HPP
  9. #include <cmath>
  10. #include <boost/geometry/core/access.hpp>
  11. namespace boost { namespace geometry { namespace projections
  12. {
  13. // Originally in pj_transform()
  14. template <typename Point>
  15. inline void set_invalid_point(Point & point)
  16. {
  17. geometry::set<0>(point, HUGE_VAL);
  18. geometry::set<1>(point, HUGE_VAL);
  19. }
  20. template <typename Point>
  21. inline bool is_invalid_point(Point const& point)
  22. {
  23. return geometry::get<0>(point) == HUGE_VAL;
  24. }
  25. }}} // namespace boost::geometry::projections
  26. #endif // BOOST_GEOMETRY_PROJECTIONS_INVALID_POINT_HPP