diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/geometry/test/srs | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/geometry/test/srs')
16 files changed, 6251 insertions, 0 deletions
diff --git a/src/boost/libs/geometry/test/srs/Jamfile.v2 b/src/boost/libs/geometry/test/srs/Jamfile.v2 new file mode 100644 index 00000000..66245c4b --- /dev/null +++ b/src/boost/libs/geometry/test/srs/Jamfile.v2 @@ -0,0 +1,30 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2017, 2018. +# Modifications 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) + +# TODO: move project transformer test to strategies +test-suite boost-geometry-srs + : + [ run projection.cpp : : : : srs_projection ] + [ run projection_epsg.cpp : : : : srs_projection_epsg ] + [ run projection_interface_d.cpp : : : : srs_projection_interface_d ] + [ run projection_interface_p4.cpp : : : : srs_projection_interface_p4 ] + [ run projection_interface_s.cpp : : : : srs_projection_interface_s ] + [ run projection_selftest.cpp : : : : srs_projection_selftest ] + [ run projections.cpp : : : : srs_projections ] + [ run projections_combined.cpp : : : : srs_projections_combined ] + [ run projections_static.cpp : : : : srs_projections_static ] + [ compile spar.cpp : : srs_spar ] + [ run srs_transformer.cpp : : : : srs_srs_transformer ] + [ run transformation_interface.cpp : : : : srs_transformation_interface ] + ; diff --git a/src/boost/libs/geometry/test/srs/check_geometry.hpp b/src/boost/libs/geometry/test/srs/check_geometry.hpp new file mode 100644 index 00000000..e188ff68 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/check_geometry.hpp @@ -0,0 +1,162 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017, 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_TEST_SRS_CHECK_GEOMETRY_HPP +#define BOOST_GEOMETRY_TEST_SRS_CHECK_GEOMETRY_HPP + + +#include <geometry_test_common.hpp> + +#include <boost/geometry/core/access.hpp> +#include <boost/geometry/core/coordinate_type.hpp> +#include <boost/geometry/core/tag.hpp> +#include <boost/geometry/core/tags.hpp> + +#include <boost/geometry/io/wkt/read.hpp> + +#include <boost/geometry/views/detail/indexed_point_view.hpp> + +#include <boost/range/begin.hpp> +#include <boost/range/end.hpp> +#include <boost/range/size.hpp> +#include <boost/range/value_type.hpp> + + +namespace test +{ + +struct check_point +{ + template <typename Point, typename T> + static void apply(Point const& point1, Point const& point2, T tol) + { + typename bg::coordinate_type<Point>::type + x1 = bg::get<0>(point1), + y1 = bg::get<1>(point1), + x2 = bg::get<0>(point2), + y2 = bg::get<1>(point2); + + BOOST_CHECK_CLOSE(x1, x2, tol); + BOOST_CHECK_CLOSE(y1, y2, tol); + } +}; + +template <typename Policy = check_point> +struct check_range +{ + template <typename Range, typename T> + static void apply(Range const& range1, Range const& range2, T tol) + { + size_t range1_count = boost::size(range1); + size_t range2_count = boost::size(range2); + BOOST_CHECK_EQUAL(range1_count, range2_count); + if (range1_count == range2_count) + { + apply(boost::begin(range1), boost::end(range1), + boost::begin(range2), tol); + } + } + template <typename It, typename T> + static void apply(It first1, It last1, It first2, T tol) + { + for ( ; first1 != last1 ; ++first1, ++first2) + Policy::apply(*first1, *first2, tol); + } +}; + + +template <typename Geometry, typename Tag = typename bg::tag<Geometry>::type> +struct check_geometry_impl +{}; + +template <typename Point> +struct check_geometry_impl<Point, bg::point_tag> + : check_point +{}; + +template <typename Segment> +struct check_geometry_impl<Segment, bg::segment_tag> +{ + template <typename T> + static void apply(Segment const& g1, Segment const& g2, T tol) + { + bg::detail::indexed_point_view<Segment const, 0> p1(g1); + bg::detail::indexed_point_view<Segment const, 1> p2(g1); + bg::detail::indexed_point_view<Segment const, 0> q1(g2); + bg::detail::indexed_point_view<Segment const, 1> q2(g2); + + check_point::apply(p1, q1, tol); + check_point::apply(p2, q2, tol); + } +}; + +template <typename MultiPoint> +struct check_geometry_impl<MultiPoint, bg::multi_point_tag> + : check_range<> +{}; + +template <typename Linestring> +struct check_geometry_impl<Linestring, bg::linestring_tag> + : check_range<> +{}; + +template <typename MultiLinestring> +struct check_geometry_impl<MultiLinestring, bg::multi_linestring_tag> + : check_range< check_range<> > +{}; + +template <typename Ring> +struct check_geometry_impl<Ring, bg::ring_tag> + : check_range<> +{}; + +template <typename Polygon> +struct check_geometry_impl<Polygon, bg::polygon_tag> +{ + template <typename T> + static void apply(Polygon const& g1, Polygon const& g2, T tol) + { + check_range<>::apply(bg::exterior_ring(g1), bg::exterior_ring(g2), tol); + check_range< check_range<> >::apply(bg::interior_rings(g1), bg::interior_rings(g2), tol); + } +}; + +template <typename MultiPolygon> +struct check_geometry_impl<MultiPolygon, bg::multi_polygon_tag> + : check_range + < + check_geometry_impl + < + typename boost::range_value<MultiPolygon>::type, + bg::polygon_tag + > + > +{}; + + +template <typename Geometry, typename T> +inline void check_geometry(Geometry const& g1, Geometry const& g2, T tol) +{ + check_geometry_impl<Geometry>::apply(g1, g2, tol); +} + +template <typename Geometry, typename T> +inline void check_geometry(Geometry const& g1, std::string const& wkt2, T tol) +{ + Geometry g2; + bg::read_wkt(wkt2, g2); + check_geometry_impl<Geometry>::apply(g1, g2, tol); +} + +} // namespace test + + +#endif // BOOST_GEOMETRY_TEST_SRS_CHECK_GEOMETRY_HPP diff --git a/src/boost/libs/geometry/test/srs/proj4.hpp b/src/boost/libs/geometry/test/srs/proj4.hpp new file mode 100644 index 00000000..10a7f4dd --- /dev/null +++ b/src/boost/libs/geometry/test/srs/proj4.hpp @@ -0,0 +1,330 @@ +// Boost.Geometry + +// Copyright (c) 2017-2019, 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_TEST_SRS_PROJ4_HPP +#define BOOST_GEOMETRY_TEST_SRS_PROJ4_HPP + +#include <string> + +#include <boost/geometry/core/access.hpp> +#include <boost/geometry/core/radian_access.hpp> + +#if defined(TEST_WITH_PROJ6) +#define TEST_WITH_PROJ5 +#endif + +#if defined(TEST_WITH_PROJ5) +#define TEST_WITH_PROJ4 + +#include <proj.h> + +#endif + +#if defined(TEST_WITH_PROJ4) +#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H + +#include <proj_api.h> + +struct pj_ptr +{ + explicit pj_ptr(projPJ ptr = NULL) + : m_ptr(ptr) + {} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + pj_ptr(pj_ptr && other) + : m_ptr(other.m_ptr) + { + other.m_ptr = NULL; + } + + pj_ptr & operator=(pj_ptr && other) + { + if (m_ptr) + pj_free(m_ptr); + m_ptr = other.m_ptr; + other.m_ptr = NULL; + return *this; + } +#endif + + projPJ get() const + { + return m_ptr; + } + + ~pj_ptr() + { + if (m_ptr) + pj_free(m_ptr); + } + +private: + pj_ptr(pj_ptr const&); + pj_ptr & operator=(pj_ptr const&); + + projPJ m_ptr; +}; +/* +struct pj_projection +{ + pj_projection(std::string const& prj) + : m_ptr(pj_init_plus(prj.c_str())) + {} + + template <typename In, typename Out> + void forward(In const& in, Out & out) const + { + double x = boost::geometry::get_as_radian<0>(in); + double y = boost::geometry::get_as_radian<1>(in); + + projUV p1; + projUV p2; + + p1.u = x; + p1.v = y; + + p2 = pj_fwd(p1, m_ptr.get()); + + boost::geometry::set_from_radian<0>(out, p2.u); + boost::geometry::set_from_radian<1>(out, p2.v); + } + + template <typename In, typename Out> + void inverse(In const& in, Out & out) const + { + double lon = boost::geometry::get_as_radian<0>(in); + double lat = boost::geometry::get_as_radian<1>(in); + + projUV p1; + projUV p2; + + p1.u = lon; + p1.v = lat; + + p2 = pj_inv(p1, m_ptr.get()); + + boost::geometry::set_from_radian<0>(out, p2.u); + boost::geometry::set_from_radian<1>(out, p2.v); + } + +private: + pj_ptr m_ptr; +};*/ + +struct pj_transformation +{ + pj_transformation(std::string const& from, std::string const& to) + : m_from(pj_init_plus(from.c_str())) + , m_to(pj_init_plus(to.c_str())) + {} + + void forward(std::vector<double> in_x, + std::vector<double> in_y, + std::vector<double> & out_x, + std::vector<double> & out_y) const + { + assert(in_x.size() == in_y.size()); + pj_transform(m_from.get(), m_to.get(), (long)in_x.size(), 1, &in_x[0], &in_y[0], NULL); + out_x = std::move(in_x); + out_y = std::move(in_y); + } + + void forward(std::vector<double> in_xy, + std::vector<double> & out_xy) const + { + assert(in_xy.size() % 2 == 0); + pj_transform(m_from.get(), m_to.get(), (long)in_xy.size() / 2, 2, &in_xy[0], &in_xy[1], NULL); + out_xy = std::move(in_xy); + } + + void forward(std::vector<std::vector<double> > const& in_xy, + std::vector<std::vector<double> > & out_xy) const + { + out_xy.resize(in_xy.size()); + for (size_t i = 0 ; i < in_xy.size(); ++i) + forward(in_xy[i], out_xy[i]); + } + + template <typename In, typename Out> + void forward(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag<In>::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + transform_point(in, out, m_from, m_to); + } + + template <typename In, typename Out> + void inverse(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag<In>::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + transform_point(in, out, m_to, m_from); + } + +private: + template <typename In, typename Out> + static void transform_point(In const& in, Out & out, + pj_ptr const& from, pj_ptr const& to) + { + double x = boost::geometry::get_as_radian<0>(in); + double y = boost::geometry::get_as_radian<1>(in); + + pj_transform(from.get(), to.get(), 1, 0, &x, &y, NULL); + + boost::geometry::set_from_radian<0>(out, x); + boost::geometry::set_from_radian<1>(out, y); + } + + pj_ptr m_from; + pj_ptr m_to; +}; + +#endif // TEST_WITH_PROJ4 + +#if defined(TEST_WITH_PROJ5) + +struct proj5_ptr +{ + explicit proj5_ptr(PJ *ptr = NULL) + : m_ptr(ptr) + {} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + proj5_ptr(proj5_ptr && other) + : m_ptr(other.m_ptr) + { + other.m_ptr = NULL; + } + + proj5_ptr & operator=(proj5_ptr && other) + { + if (m_ptr) + proj_destroy(m_ptr); + m_ptr = other.m_ptr; + other.m_ptr = NULL; + return *this; + } +#endif + + PJ *get() const + { + return m_ptr; + } + + ~proj5_ptr() + { + if (m_ptr) + proj_destroy(m_ptr); + } + +private: + proj5_ptr(proj5_ptr const&); + proj5_ptr & operator=(proj5_ptr const&); + + PJ *m_ptr; +}; + +struct proj5_transformation +{ + proj5_transformation(std::string const& to) + : m_proj(proj_create(PJ_DEFAULT_CTX, to.c_str())) + {} + + void forward(std::vector<PJ_COORD> in, + std::vector<PJ_COORD> & out) const + { + proj_trans_array(m_proj.get(), PJ_FWD, in.size(), &in[0]); + out = std::move(in); + } + + template <typename In, typename Out> + void forward(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag<In>::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + PJ_COORD c; + c.lp.lam = boost::geometry::get_as_radian<0>(in); + c.lp.phi = boost::geometry::get_as_radian<1>(in); + + c = proj_trans(m_proj.get(), PJ_FWD, c); + + boost::geometry::set_from_radian<0>(out, c.xy.x); + boost::geometry::set_from_radian<1>(out, c.xy.y); + } + +private: + proj5_ptr m_proj; +}; + +#endif // TEST_WITH_PROJ5 + +#if defined(TEST_WITH_PROJ6) + +struct proj6_transformation +{ + proj6_transformation(std::string const& from, std::string const& to) + : m_proj(proj_create_crs_to_crs(PJ_DEFAULT_CTX, from.c_str(), to.c_str(), NULL)) + { + //proj_normalize_for_visualization(0, m_proj.get()); + } + + void forward(std::vector<PJ_COORD> in, + std::vector<PJ_COORD> & out) const + { + proj_trans_array(m_proj.get(), PJ_FWD, in.size(), &in[0]); + out = std::move(in); + } + + template <typename In, typename Out> + void forward(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag<In>::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + PJ_COORD c; + c.lp.lam = boost::geometry::get_as_radian<0>(in); + c.lp.phi = boost::geometry::get_as_radian<1>(in); + + c = proj_trans(m_proj.get(), PJ_FWD, c); + + boost::geometry::set_from_radian<0>(out, c.xy.x); + boost::geometry::set_from_radian<1>(out, c.xy.y); + } + +private: + proj5_ptr m_proj; +}; + +#endif // TEST_WITH_PROJ6 + +#endif // BOOST_GEOMETRY_TEST_SRS_PROJ4_HPP diff --git a/src/boost/libs/geometry/test/srs/projection.cpp b/src/boost/libs/geometry/test/srs/projection.cpp new file mode 100644 index 00000000..ed65c142 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection.cpp @@ -0,0 +1,95 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + + +#define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE + +#include <geometry_test_common.hpp> + +#include <boost/geometry/srs/projection.hpp> + +#include <boost/geometry/algorithms/transform.hpp> +#include <boost/geometry/core/coordinate_type.hpp> + +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/adapted/c_array.hpp> +#include <test_common/test_point.hpp> + + +namespace srs = bg::srs; + +template <typename P1, typename P2, typename Params> +void test_one(double lon, double lat, + typename bg::coordinate_type<P2>::type x, + typename bg::coordinate_type<P2>::type y, + Params const& params) +{ + // hybrid interface disabled by default + // static_proj4 default ctor, dynamic parameters passed + srs::projection<Params> prj(params); + + P1 ll; + bg::set<0>(ll, lon); + bg::set<1>(ll, lat); + + P2 xy; + prj.forward(ll, xy); + + BOOST_CHECK_CLOSE(bg::get<0>(xy), x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(xy), y, 0.001); +} + +template <typename P> +void test_all() +{ + typedef typename bg::coordinate_type<P>::type coord_type; + typedef bg::model::point<coord_type, 2, bg::cs::geographic<bg::degree> > point_type; + + using namespace srs::spar; + + // aea + test_one<point_type, P> + (4.897000, 52.371000, 334609.583974, 5218502.503686, + parameters<proj_aea, ellps_wgs84, units_m, lat_1<>, lat_2<> >( + proj_aea(), ellps_wgs84(), units_m(), lat_1<>(55), lat_2<>(65))); +} + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(bg::cs::cartesian) + +int test_main(int, char* []) +{ + //test_all<int[2]>(); + test_all<float[2]>(); + test_all<double[2]>(); + + // 2D -> 3D + //test_all<test::test_point>(); + + //test_all<bg::model::d2::point_xy<int> >(); + test_all<bg::model::d2::point_xy<float> >(); + test_all<bg::model::d2::point_xy<double> >(); + test_all<bg::model::d2::point_xy<long double> >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_epsg.cpp b/src/boost/libs/geometry/test/srs/projection_epsg.cpp new file mode 100644 index 00000000..79fcd2e8 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_epsg.cpp @@ -0,0 +1,93 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + + +#include <boost/core/ignore_unused.hpp> + +#include <geometry_test_common.hpp> + +#include <boost/geometry/srs/epsg.hpp> +#include <boost/geometry/srs/projection.hpp> + +#include <boost/geometry/core/coordinate_type.hpp> + +#include <boost/geometry/geometries/adapted/c_array.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <test_common/test_point.hpp> + +namespace srs = bg::srs; + +template <int E, typename P1, typename P2> +void test_one(double lon, double lat, + typename bg::coordinate_type<P2>::type x, + typename bg::coordinate_type<P2>::type y) +{ + srs::projection<srs::static_epsg<E> > prj; + + P1 ll; + bg::set<0>(ll, lon); + bg::set<1>(ll, lat); + + P2 xy; + bg::set<0>(xy, 0.0); + bg::set<1>(xy, 0.0); + prj.forward(ll, xy); + + BOOST_CHECK_CLOSE(bg::get<0>(xy), x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(xy), y, 0.001); +} + +template <typename D, typename P> +void test_deg_rad(double factor) +{ + typedef typename bg::coordinate_type<P>::type coord_type; + typedef bg::model::point<coord_type, 2, bg::cs::geographic<D> > point_type; + + // sterea + test_one<28992, point_type, P>(4.897000 * factor, 52.371000 * factor, 121590.388077, 487013.903377); + // utm + test_one<29118, point_type, P>(4.897000 * factor, 52.371000 * factor, 4938115.7568751378, 9139797.6057944782); +} + +template <typename P> +void test_all() +{ + test_deg_rad<bg::degree, P>(1.0); + test_deg_rad<bg::radian, P>(bg::math::d2r<double>()); +} + +int test_main(int, char* []) +{ + // Commented out most the types because otherwise it cannot be linked + //test_all<int[2]>(); + //test_all<float[2]>(); + //test_all<double[2]>(); + //test_all<test::test_point>(); + //test_all<bg::model::d2::point_xy<int> >(); + ////test_all<bg::model::d2::point_xy<float> >(); + ////test_all<bg::model::d2::point_xy<long double> >(); + + test_all<bg::model::d2::point_xy<double> >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_interface_d.cpp b/src/boost/libs/geometry/test/srs/projection_interface_d.cpp new file mode 100644 index 00000000..2671651c --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_interface_d.cpp @@ -0,0 +1,67 @@ +// Boost.Geometry +// Unit Test + +// 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) + + +#include <geometry_test_common.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/srs/epsg.hpp> +#include <boost/geometry/srs/esri.hpp> +#include <boost/geometry/srs/iau2000.hpp> +#include <boost/geometry/srs/projection.hpp> + +#include "check_geometry.hpp" + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef point<double, 2, cs::geographic<degree> > point_ll; + typedef point<double, 2, cs::cartesian> point_xy; + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<> prj = epsg(2000); + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(9413505.3284665551 237337.74515944949)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + // TODO: investigate this wierd result + test::check_geometry(pt_ll2, "POINT(-2.4463131191981073 1.5066638962045082)", 0.001); + + projection<> prj2 = esri(37001); + projection<> prj3 = iau2000(19900); + } + + { + using namespace boost::geometry::srs::dpar; + + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<> prj = parameters<>(proj_tmerc)(ellps_wgs84)(units_m); + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.001); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_interface_p4.cpp b/src/boost/libs/geometry/test/srs/projection_interface_p4.cpp new file mode 100644 index 00000000..731ad412 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_interface_p4.cpp @@ -0,0 +1,124 @@ +// Boost.Geometry +// Unit Test + +// 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) + + +#include <geometry_test_common.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/srs/projection.hpp> + +#include "check_geometry.hpp" + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef point<double, 2, cs::geographic<degree> > point_ll; + typedef point<double, 2, cs::cartesian> point_xy; + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<> prj = proj4("+proj=tmerc +ellps=WGS84 +units=m"); + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.001); + } + + // run-time errors + { + point_ll pt_ll(1, 1); + point_xy pt_xy(0, 0); + + BOOST_CHECK_THROW(projection<> prj1((proj4(""))), bg::projection_exception); + + BOOST_CHECK_THROW(projection<> prj1((proj4("+proj=abcd"))), bg::projection_exception); + + projection<> prj3 = proj4("+proj=bacon +a=6400000"); + BOOST_CHECK_THROW(prj3.inverse(pt_xy, pt_ll), bg::projection_exception); + } + + { + segment<point_ll> seg_ll; + segment<point_xy> seg_xy; + linestring<point_ll> ls_ll; + linestring<point_xy> ls_xy; + ring<point_ll> ring_ll; + ring<point_xy> ring_xy; + polygon<point_ll> poly_ll; + polygon<point_xy> poly_xy; + multi_point<point_ll> mpt_ll; + multi_point<point_xy> mpt_xy; + multi_linestring<linestring<point_ll> > mls_ll; + multi_linestring<linestring<point_xy> > mls_xy; + multi_polygon<polygon<point_ll> > mpoly_ll; + multi_polygon<polygon<point_xy> > mpoly_xy; + + bg::read_wkt("LINESTRING(0 0, 1 1)", seg_ll); + bg::read_wkt("LINESTRING(0 0, 1 1, 2 2)", ls_ll); + bg::read_wkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", ring_ll); + bg::read_wkt("POLYGON((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))", poly_ll); + bg::read_wkt("MULTIPOINT(0 0, 1 1, 2 2)", mpt_ll); + bg::read_wkt("MULTILINESTRING((0 0, 1 1),(2 2, 3 3))", mls_ll); + bg::read_wkt("MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)),((3 3,3 4,4 4,4 3,3 3)))", mpoly_ll); + + projection<> prj = proj4("+proj=tmerc +ellps=WGS84 +units=m"); + + prj.forward(seg_ll, seg_xy); + prj.forward(ls_ll, ls_xy); + prj.forward(ring_ll, ring_xy); + prj.forward(poly_ll, poly_xy); + prj.forward(mpt_ll, mpt_xy); + prj.forward(mls_ll, mls_xy); + prj.forward(mpoly_ll, mpoly_xy); + + test::check_geometry(seg_xy, "LINESTRING(0 0,111308 110591)", 0.001); + test::check_geometry(ls_xy, "LINESTRING(0 0,111308 110591,222550 221285)", 0.001); + test::check_geometry(ring_xy, "POLYGON((0 0,0 110574,111308 110591,111325 0,0 0))", 0.001); + test::check_geometry(poly_xy, "POLYGON((0 0,0 331726,333657 332183,334112 0,0 0),(111308 110591,222651 110642,222550 221285,111258 221183,111308 110591))", 0.001); + test::check_geometry(mpt_xy, "MULTIPOINT((0 0),(111308 110591),(222550 221285))", 0.001); + test::check_geometry(mls_xy, "MULTILINESTRING((0 0,111308 110591),(222550 221285,333657 332183))", 0.001); + test::check_geometry(mpoly_xy, "MULTIPOLYGON(((0 0,0 331726,333657 332183,334112 0,0 0),(111308 110591,222651 110642,222550 221285,111258 221183,111308 110591)),((333657 332183,333302 442913,444561 443388,445034 332540,333657 332183)))", 0.001); + + bg::clear(seg_ll); + bg::clear(ls_ll); + bg::clear(ring_ll); + bg::clear(poly_ll); + bg::clear(mpt_ll); + bg::clear(mls_ll); + bg::clear(mpoly_ll); + + prj.inverse(seg_xy, seg_ll); + prj.inverse(ls_xy, ls_ll); + prj.inverse(ring_xy, ring_ll); + prj.inverse(poly_xy, poly_ll); + prj.inverse(mpt_xy, mpt_ll); + prj.inverse(mls_xy, mls_ll); + prj.inverse(mpoly_xy, mpoly_ll); + + test::check_geometry(seg_ll, "LINESTRING(0 0, 1 1)", 0.001); + test::check_geometry(ls_ll, "LINESTRING(0 0, 1 1, 2 2)", 0.001); + test::check_geometry(ring_ll, "POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", 0.001); + test::check_geometry(poly_ll, "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))", 0.001); + test::check_geometry(mpt_ll, "MULTIPOINT(0 0, 1 1, 2 2)", 0.001); + test::check_geometry(mls_ll, "MULTILINESTRING((0 0, 1 1),(2 2, 3 3))", 0.001); + test::check_geometry(mpoly_ll, "MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)),((3 3,3 4,4 4,4 3,3 3)))", 0.001); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_interface_s.cpp b/src/boost/libs/geometry/test/srs/projection_interface_s.cpp new file mode 100644 index 00000000..571eb3ac --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_interface_s.cpp @@ -0,0 +1,96 @@ +// Boost.Geometry +// Unit Test + +// 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) + + +#include <geometry_test_common.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/srs/epsg.hpp> +#include <boost/geometry/srs/esri.hpp> +#include <boost/geometry/srs/iau2000.hpp> +#include <boost/geometry/srs/projection.hpp> + +#include "check_geometry.hpp" + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef point<double, 2, cs::geographic<degree> > point_ll; + typedef point<double, 2, cs::cartesian> point_xy; + + { + using namespace boost::geometry::srs::spar; + + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<parameters<proj_tmerc, ellps_wgs84, units_m> > prj; + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.001); + } + + { + using namespace boost::geometry::srs::spar; + + projection<parameters<proj_tmerc> > prj1; + projection<parameters<proj_tmerc, ellps_wgs84> > prj2; + projection<parameters<proj_tmerc, ellps_wgs84, datum_wgs84> > prj3; + projection<parameters<proj_tmerc, ellps_wgs84, x_0<>, y_0<> > > prj4 + = parameters<proj_tmerc, ellps_wgs84, x_0<>, y_0<> >( + proj_tmerc(), ellps_wgs84(), x_0<>(0), y_0<>(0)); + + typedef spheroid<double> sph; + typedef ellps<sph> ell; + typedef proj_tmerc prj; + projection<parameters<ell, prj> > prj5 + = parameters<ell, prj>(ell(sph(1000, 999))); + } + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<static_epsg<2000> > prj; + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(9413505.3284665551 237337.74515944949)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + // TODO: investigate this wierd result + test::check_geometry(pt_ll2, "POINT(-2.4463131191981073 1.5066638962045082)", 0.001); + + projection<static_esri<37001> > prj2; + projection<static_iau2000<19900> > prj3; + } + + // compile-time errors + { + point_ll pt_ll(1, 1); + point_xy pt_xy(0, 0); + + //projection<spar::parameters<int> > prj1; + //projection<int> prj2; + + projection<spar::parameters<spar::proj_bacon> > prj3; + //prj3.inverse(pt_xy, pt_ll); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_selftest.cpp b/src/boost/libs/geometry/test/srs/projection_selftest.cpp new file mode 100644 index 00000000..cf98f3c3 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_selftest.cpp @@ -0,0 +1,115 @@ +// Boost.Geometry +// Unit Test + +// 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) + + +#include <geometry_test_common.hpp> + +#include <iostream> + +#include <boost/geometry/srs/projection.hpp> + +#include "projection_selftest_cases.hpp" +#include "proj4.hpp" + + +void test_projection(std::string const& id, std::string const& parameters, + const LL * fwd_in, const XY * fwd_expected, + const XY * inv_in, const LL * inv_expected) +{ + bg::srs::projection<> prj = bg::srs::proj4(parameters); + +#ifdef TEST_WITH_PROJ4 + pj_projection pj_par(parameters); +#endif + + for (std::size_t i = 0 ; i < 4 ; ++i) + { + if (bg::get<0>(fwd_expected[i]) == HUGE_VAL) + break; + + { + XY fwd_out; + prj.forward(fwd_in[i], fwd_out); + + bool fwd_eq = bg::math::abs(bg::get<0>(fwd_out) - bg::get<0>(fwd_expected[i])) < 1e-7 + && bg::math::abs(bg::get<1>(fwd_out) - bg::get<1>(fwd_expected[i])) < 1e-7; + + BOOST_CHECK_MESSAGE((fwd_eq), + std::setprecision(16) << "Result of " << id << " forward projection {" + << bg::wkt(fwd_out) << "} different than expected {" + << bg::wkt(fwd_expected[i]) << "}"); + +#ifdef TEST_WITH_PROJ4 + { + XY pj_xy; + pj_par.forward(fwd_in[i], pj_xy); + double d1 = bg::math::abs(bg::get<0>(fwd_out) - bg::get<0>(pj_xy)); + double d2 = bg::math::abs(bg::get<1>(fwd_out) - bg::get<1>(pj_xy)); + double d = (std::max)(d1, d2); + bool same_as_pj = d < 1e-15; + BOOST_CHECK_MESSAGE((same_as_pj), + std::setprecision(16) << "Result of " << id << " forward projection {" + << bg::wkt(fwd_out) << "} different than Proj4 {" + << bg::wkt(pj_xy) << "} by " << d); + } +#endif + } + + if (bg::get<0>(inv_expected[i]) == HUGE_VAL) + break; + + { + LL inv_out; + prj.inverse(inv_in[i], inv_out); + + bool inv_eq = bg::math::abs(bg::get<0>(inv_out) - bg::get<0>(inv_expected[i])) < 1e-7 + && bg::math::abs(bg::get<1>(inv_out) - bg::get<1>(inv_expected[i])) < 1e-7; + + BOOST_CHECK_MESSAGE((inv_eq), + std::setprecision(16) << "Result of " << id << " inverse projection {" + << bg::wkt(inv_out) << "} different than expected {" + << bg::wkt(inv_expected[i]) << "}"); + +#ifdef TEST_WITH_PROJ4 + { + LL pj_ll; + pj_par.inverse(inv_in[i], pj_ll); + double d1 = bg::math::abs(bg::get<0>(inv_out) - bg::get<0>(pj_ll)); + double d2 = bg::math::abs(bg::get<1>(inv_out) - bg::get<1>(pj_ll)); + double d = (std::max)(d1, d2); + bool same_as_pj = d < 1e-15; + BOOST_CHECK_MESSAGE((same_as_pj), + std::setprecision(16) << "Result of " << id << " inverse projection {" + << bg::wkt(inv_out) << "} different than Proj4 {" + << bg::wkt(pj_ll) << "} by " << d); + } +#endif + } + } +} + +void test_projections(const projection_case * cases, std::size_t n) +{ + for (std::size_t i = 0 ; i < n ; ++i) + { + projection_case const& pcas = cases[i]; + + test_projection(pcas.id, pcas.args, + pcas.fwd_in, pcas.fwd_expect, + pcas.inv_in, pcas.inv_expect); + } +} + +int test_main(int, char*[]) +{ + test_projections(projection_cases, sizeof(projection_cases)/sizeof(projection_case)); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp b/src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp new file mode 100644 index 00000000..1bf4dc15 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp @@ -0,0 +1,3935 @@ +// Boost.Geometry +// Unit Test + +// 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) + +// This file contains test cases converted from PROJ4, http://trac.osgeo.org/proj +// PROJ4 is originally written by Gerald Evenden (then of the USGS) +// PROJ4 is maintained by Frank Warmerdam +// Test cases was converted to Boost.Geometry by Adam Wulkiewicz + +// Original copyright notice: + +// Copyright (c) 1995, Gerald Evenden + +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef BOOST_GEOMETRY_TEST_SRS_PROJECTION_SELFTEST_CASES_HPP +#define BOOST_GEOMETRY_TEST_SRS_PROJECTION_SELFTEST_CASES_HPP + + +#include <geometry_test_common.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/register/point.hpp> + + +struct XY { double x, y; }; +struct LL { double lon, lat; }; + +BOOST_GEOMETRY_REGISTER_POINT_2D(XY, double, bg::cs::cartesian, x, y) +BOOST_GEOMETRY_REGISTER_POINT_2D(LL, double, bg::cs::geographic<bg::degree>, lon, lat) + +struct projection_case +{ + std::string id; + std::string args; + LL fwd_in[4]; + XY fwd_expect[4]; + XY inv_in[4]; + LL inv_expect[4]; +}; + +static const projection_case projection_cases[] = { + { + "aea_e", + "+proj=aea +ellps=GRS80 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222571.60875710563, 110653.32674302977}, + {222706.30650839131, -110484.26714439997}, + {-222571.60875710563, 110653.32674302977}, + {-222706.30650839131, -110484.26714439997} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966310597749514, 0.00090436885862202158}, + {0.0017966300767030448, -0.00090437009538581453}, + {-0.0017966310597749514, 0.00090436885862202158}, + {-0.0017966300767030448, -0.00090437009538581453} + } + },{ + "aea_s", + "+proj=aea +R=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223334.08517088494, 111780.43188447191}, + {223470.15499168713, -111610.33943099028}, + {-223334.08517088494, 111780.43188447191}, + {-223470.15499168713, -111610.33943099028} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904935979658752, 0.00089524594491375306}, + {0.0017904926216016812, -0.00089524716502493225}, + {-0.0017904935979658752, 0.00089524594491375306}, + {-0.0017904926216016812, -0.00089524716502493225} + } + },{ + "leac_e", + "+proj=leac +ellps=GRS80 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {220685.14054297868, 112983.50088939646}, + {224553.31227982609, -108128.63674487274}, + {-220685.14054297868, 112983.50088939646}, + {-224553.31227982609, -108128.63674487274} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966446840328458, 0.00090435171340223211}, + {0.0017966164523713021, -0.00090438724081843625}, + {-0.0017966446840328458, 0.00090435171340223211}, + {-0.0017966164523713021, -0.00090438724081843625} + } + },{ + "leac_s", + "+proj=leac +R=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {221432.86859285168, 114119.45452653214}, + {225331.72412711097, -109245.82943505641}, + {-221432.86859285168, 114119.45452653214}, + {-225331.72412711097, -109245.82943505641} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017905070979748127, 0.00089522906964877795}, + {0.001790479121519977, -0.00089526404022281043}, + {-0.0017905070979748127, 0.00089522906964877795}, + {-0.001790479121519977, -0.00089526404022281043} + } + },{ + "aeqd_e", + "+proj=aeqd +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222616.522190051648, 110596.996549550197}, + { 222616.522190051648, -110596.996549550211}, + {-222616.522190051648, 110596.996549550197}, + {-222616.522190051648, -110596.996549550211} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056838724787, 0.000904369476930248902}, + { 0.00179663056838724787, -0.000904369476930248469}, + {-0.00179663056838724787, 0.000904369476930248902}, + {-0.00179663056838724787, -0.000904369476930248469} + } + },{ + "aeqd_s", + "+proj=aeqd +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223379.456047271, 111723.757570854126}, + { 223379.456047271, -111723.757570854126}, + {-223379.456047271, 111723.757570854126}, + {-223379.456047271, -111723.757570854126} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310992953335, 0.000895246554746200623}, + { 0.00179049310992953335, -0.000895246554746200623}, + {-0.00179049310992953335, 0.000895246554746200623}, + {-0.00179049310992953335, -0.000895246554746200623} + } + },{ + "airy", + "+proj=airy +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 189109.88690862127, 94583.752387504152}, + { 189109.88690862127, -94583.752387504152}, + {-189109.88690862127, 94583.752387504152}, + {-189109.88690862127, -94583.752387504152} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "aitoff", + "+proj=aitoff +R=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223379.45881169615, 111706.74288385305}, + {223379.45881169615, -111706.74288385305}, + {-223379.45881169615, 111706.74288385305}, + {-223379.45881169615, -111706.74288385305} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931100388164, 0.00089524655491012516}, + {0.0017904931100388164, -0.00089524655491012516}, + {-0.0017904931100388164, 0.00089524655491012516}, + {-0.0017904931100388164, -0.00089524655491012516} + } + },{ + "wintri", + "+proj=wintri +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223390.80153348515, 111703.90750574505}, + {223390.80153348515, -111703.90750574505}, + {-223390.80153348515, 111703.90750574505}, + {-223390.80153348515, -111703.90750574505} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931099113196, 0.00089524655490101819}, + {0.0017904931099113196, -0.00089524655490101819}, + {-0.0017904931099113196, 0.00089524655490101819}, + {-0.0017904931099113196, -0.00089524655490101819} + } + },{ + "august", + "+proj=august +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223404.97818097242, 111722.34028976287}, + {223404.97818097242, -111722.34028976287}, + {-223404.97818097242, 111722.34028976287}, + {-223404.97818097242, -111722.34028976287} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "bacon", + "+proj=bacon +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223334.13255596498, 175450.72592266591}, + {223334.13255596498, -175450.72592266591}, + {-223334.13255596498, 175450.72592266591}, + {-223334.13255596498, -175450.72592266591} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "apian", + "+proj=apian +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.57735525275, 111701.07212763709}, + { 223374.57735525275, -111701.07212763709}, + {-223374.57735525275, 111701.07212763709}, + {-223374.57735525275, -111701.07212763709} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "ortel", + "+proj=ortel +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.57735525275, 111701.07212763709}, + { 223374.57735525275, -111701.07212763709}, + {-223374.57735525275, 111701.07212763709}, + {-223374.57735525275, -111701.07212763709} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "bipc_e", + "+proj=bipc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {2452160.2177257561, -14548450.759654747}, + {2447915.213725341, -14763427.21279873}, + {2021695.5229349085, -14540413.695283702}, + {2018090.5030046992, -14755620.651414108} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-73.038700284978702, 17.248118466239116}, + {-73.03730373933017, 17.249414978178777}, + {-73.03589317304332, 17.245536403008771}, + {-73.034496627213585, 17.246832895573739} + } + },{ + "bipc_s", + "+proj=bipc +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {2460565.7409749646, -14598319.9893308}, + {2456306.1859352002, -14814033.339502094}, + {2028625.4978190989, -14590255.375482792}, + {2025008.1205891429, -14806200.018759441} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-73.038693104942126, 17.248116270440242}, + {-73.037301330021322, 17.24940835333777}, + {-73.035895582251086, 17.245543027866539}, + {-73.034503807150301, 17.246835091521532} + } + },{ + "boggs", + "+proj=boggs +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 211949.70080818201, 117720.99830541089}, + { 211949.70080818201, -117720.99830541089}, + {-211949.70080818201, 117720.99830541089}, + {-211949.70080818201, -117720.99830541089}, + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "bonne_e", + "+proj=bonne +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.29609715697, 55321.139565494814}, + { 222605.29609923941, -165827.64779905154}, + {-222605.29609715697, 55321.139565494814}, + {-222605.29609923941, -165827.64779905154} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966987691132891, 0.50090436853737497}, + { 0.0017966982774478867, 0.4990956309655612}, + {-0.0017966987691132891, 0.50090436853737497}, + {-0.0017966982774478867, 0.4990956309655612} + } + },{ + "bonne_s", + "+proj=bonne +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.11557252839, 55884.555246393575}, + { 223368.11557463196, -167517.59936969393}, + {-223368.11557252839, 55884.555246393575}, + {-223368.11557463196, -167517.59936969393} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017905615332457991, 0.50089524631087834}, + { 0.0017905610449335603, 0.49910475320072978}, + {-0.0017905615332457991, 0.50089524631087834}, + {-0.0017905610449335603, 0.49910475320072978} + } + }, + // NOT IMPLEMENTED IN Boost.Geometry + /* + { + "calcofi_e", + "+proj=calcofi +ellps=GRS80 +lat_1=0.5 +lat_2=2 +no_defs", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {508.44487214981905, -1171.7648604175156}, + {514.99916815188112, -1145.8219814677668}, + {500.68538412539851, -1131.4453779204598}, + {507.36971913666355, -1106.1782014834275} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-110.36330792469906, 12.032056975840137}, + {-98.455008863288782, 18.698723642506803}, + {-207.4470245036909, 81.314089278595247}, + {-62.486322854481287, 87.980755945261919} + } + },{ + "calcofi_s", + "+proj=calcofi +R=6400000 +lat_1=0.5 +lat_2=2 +no_defs", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {507.09050748781806, -1164.7273751978314}, + {513.68613637462886, -1138.9992682173072}, + {499.33626147591531, -1124.4351309968195}, + {506.0605703929898, -1099.3756650673038} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-110.30519040955151, 12.032056975840137}, + {-98.322360950234085, 18.698723642506803}, + {-207.54490681381429, 81.314089278595247}, + {-62.576950371885275, 87.980755945261919} + } + },*/ + // NOTE: cart projection test cases are implemented differently in Proj4 + { + "cass_e", + "+proj=cass +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.28577699114, 110642.22925399939}, + { 222605.28577699114, -110642.22925399939}, + {-222605.28577699114, 110642.22925399939}, + {-222605.28577699114, -110642.22925399939} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305684613522, 0.00090436947663183841}, + { 0.0017966305684613522, -0.00090436947663183841}, + {-0.0017966305684613522, 0.00090436947663183841}, + {-0.0017966305684613522, -0.00090436947663183841} + } + },{ + "cass_s", + "+proj=cass +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.10520348375, 111769.14504058579}, + { 223368.10520348375, -111769.14504058579}, + {-223368.10520348375, 111769.14504058579}, + {-223368.10520348375, -111769.14504058579} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.00089524655445477922}, + { 0.0017904931100023887, -0.00089524655445477922}, + {-0.0017904931100023887, 0.00089524655445477922}, + {-0.0017904931100023887, -0.00089524655445477922} + } + },{ + "cc", + "+proj=cc +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.14425527418, 111712.41554059254}, + {223402.14425527418, -111712.41554059254}, + {-223402.14425527418, 111712.41554059254}, + {-223402.14425527418, -111712.41554059254} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931097838226, 0.00089524655481905597}, + {0.0017904931097838226, -0.00089524655481905597}, + {-0.0017904931097838226, 0.00089524655481905597}, + {-0.0017904931097838226, -0.00089524655481905597} + } + },{ + "cea_e", + "+proj=cea +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222638.981586547132, 110568.812396267356}, + { 222638.981586547132, -110568.812396265886}, + {-222638.981586547132, 110568.812396267356}, + {-222638.981586547132, -110568.812396265886} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056823904264, 0.000904369476105564289}, + { 0.00179663056823904264, -0.000904369476105564289}, + {-0.00179663056823904264, 0.000904369476105564289}, + {-0.00179663056823904264, -0.000904369476105564289} + } + },{ + "cea_s", + "+proj=cea +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111695.401198614476}, + { 223402.144255274179, -111695.401198614476}, + {-223402.144255274179, 111695.401198614476}, + {-223402.144255274179, -111695.401198614476} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554928338998}, + { 0.00179049310978382265, -0.000895246554928338998}, + {-0.00179049310978382265, 0.000895246554928338998}, + {-0.00179049310978382265, -0.000895246554928338998} + } + },{ + "chamb", + "+proj=chamb +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-27864.7795868005815, -223364.324593274243}, + {-251312.283053493476, -223402.145526208304}, + {-27864.7856491046077, 223364.327328827145}, + {-251312.289116443484, 223402.142197287147} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "collg", + "+proj=collg +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {249872.921577929839, 99423.1747884602082}, + {254272.532301245432, -98559.3077607425657}, + {-249872.921577929839, 99423.1747884602082}, + {-254272.532301245432, -98559.3077607425657} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00158679719207879865, 0.00101017310941749921}, + {0.001586769215623956, -0.00101018201458258111}, + {-0.00158679719207879865, 0.00101017310941749921}, + {-0.001586769215623956, -0.00101018201458258111} + } + }, + // NOT IMPLEMENTED IN Boost.Geometry + /*{ + "comill", + "+proj=comill +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.144255274179, 110611.859089458536}, + {223402.144255274179, -110611.859089458536}, + {-223402.144255274179, 110611.859089458536}, + {-223402.144255274179, -110611.859089458536} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00179049310978382265, 0.000904106801510605831}, + {0.00179049310978382265, -0.000904106801510605831}, + {-0.00179049310978382265, 0.000904106801510605831}, + {-0.00179049310978382265, -0.000904106801510605831} + } + },*/{ + "crast", + "+proj=crast +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {218280.142056780722, 114306.045604279774}, + {218280.142056780722, -114306.045604279774}, + {-218280.142056780722, 114306.045604279774}, + {-218280.142056780722, -114306.045604279774} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00183225941982580187, 0.00087483943098902331}, + {0.00183225941982580187, -0.00087483943098902331}, + {-0.00183225941982580187, 0.00087483943098902331}, + {-0.00183225941982580187, -0.00087483943098902331} + } + },{ + "denoy", + "+proj=denoy +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223377.422876954137, 111701.07212763709}, + { 223377.422876954137, -111701.07212763709}, + {-223377.422876954137, 111701.07212763709}, + {-223377.422876954137, -111701.07212763709} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "eck1", + "+proj=eck1 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 204680.88820295094, 102912.17842606473}, + { 204680.88820295094, -102912.17842606473}, + {-204680.88820295094, 102912.17842606473}, + {-204680.88820295094, -102912.17842606473} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019434150820034624, 0.00097170229538813102}, + { 0.0019434150820034624, -0.00097170229538813102}, + {-0.0019434150820034624, 0.00097170229538813102}, + {-0.0019434150820034624, -0.00097170229538813102} + } + },{ + "eck2", + "+proj=eck2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 204472.87090796008, 121633.73497524235}, + { 204472.87090796008, -121633.73497524235}, + {-204472.87090796008, 121633.73497524235}, + {-204472.87090796008, -121633.73497524235} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019434150820034624, 0.00082480429919795412}, + { 0.0019434150820034624, -0.00082480429919795412}, + {-0.0019434150820034624, 0.00082480429919795412}, + {-0.0019434150820034624, -0.00082480429919795412} + } + },{ + "eck3", + "+proj=eck3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 188652.01572153764, 94328.919337031271}, + { 188652.01572153764, -94328.919337031271}, + {-188652.01572153764, 94328.919337031271}, + {-188652.01572153764, -94328.919337031271} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0021202405520236059, 0.0010601202759750307}, + { 0.0021202405520236059, -0.0010601202759750307}, + {-0.0021202405520236059, 0.0010601202759750307}, + {-0.0021202405520236059, -0.0010601202759750307} + } + },{ + "eck4", + "+proj=eck4 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 188646.38935641639, 132268.54017406539}, + { 188646.38935641639, -132268.54017406539}, + {-188646.38935641639, 132268.54017406539}, + {-188646.38935641639, -132268.54017406539} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0021202405520236059, 0.00075601458836610643}, + { 0.0021202405520236059, -0.00075601458836610643}, + {-0.0021202405520236059, 0.00075601458836610643}, + {-0.0021202405520236059, -0.00075601458836610643} + } + },{ + "eck5", + "+proj=eck5 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 197031.39213406085, 98523.198847226551}, + { 197031.39213406085, -98523.198847226551}, + {-197031.39213406085, 98523.198847226551}, + {-197031.39213406085, -98523.198847226551} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.002029978749734037, 0.001014989374787388}, + {0.002029978749734037, -0.001014989374787388}, + {-0.002029978749734037, 0.001014989374787388}, + {-0.002029978749734037, -0.001014989374787388} + } + },{ + "eqc", + "+proj=eqc +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111701.07212763709}, + { 223402.144255274179, -111701.07212763709}, + {-223402.144255274179, 111701.07212763709}, + {-223402.144255274179, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554891911323}, + { 0.00179049310978382265, -0.000895246554891911323}, + {-0.00179049310978382265, 0.000895246554891911323}, + {-0.00179049310978382265, -0.000895246554891911323} + } + },{ + "eqdc_e", + "+proj=eqdc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222588.440269285755, 110659.134907347048}, + { 222756.836702042434, -110489.578087220681}, + {-222588.440269285755, 110659.134907347048}, + {-222756.836702042434, -110489.578087220681} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179635944879094839, 0.000904368858588402644}, + { 0.00179635822020772734, -0.000904370095529954975}, + {-0.00179635944879094839, 0.000904368858588402644}, + {-0.00179635822020772734, -0.000904370095529954975} + } + },{ + "eqdc_s", + "+proj=eqdc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223351.088175113517, 111786.108747173785}, + { 223521.200266735133, -111615.970741240744}, + {-223351.088175113517, 111786.108747173785}, + {-223521.200266735133, -111615.970741240744} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017902210900486641, 0.000895245944814909169}, + { 0.00179021986984890255, -0.000895247165333684842}, + {-0.0017902210900486641, 0.000895245944814909169}, + {-0.00179021986984890255, -0.000895247165333684842} + } + },{ + "fahey", + "+proj=fahey +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 182993.34464912376, 101603.19356988439}, + { 182993.34464912376, -101603.19356988439}, + {-182993.34464912376, 101603.19356988439}, + {-182993.34464912376, -101603.19356988439} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0021857886080359551, 0.00098424601668238403}, + {0.0021857886080359551, -0.00098424601668238403}, + {-0.0021857886080359551, 0.00098424601668238403}, + {-0.0021857886080359551, -0.00098424601668238403} + } + },{ + "fouc_s", + "+proj=fouc_s +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.14425527424, 111695.40119861449}, + { 223402.14425527424, -111695.40119861449}, + {-223402.14425527424, 111695.40119861449}, + {-223402.14425527424, -111695.40119861449} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097838226, 0.000895246554928339}, + { 0.0017904931097838226, -0.000895246554928339}, + {-0.0017904931097838226, 0.000895246554928339}, + {-0.0017904931097838226, -0.000895246554928339} + } + },{ + "gall", + "+proj=gall +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 157969.17113451968, 95345.249178385886}, + { 157969.17113451968, -95345.249178385886}, + {-157969.17113451968, 95345.249178385886}, + {-157969.17113451968, -95345.249178385886} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0025321396391918614, 0.001048846580346495}, + { 0.0025321396391918614, -0.001048846580346495}, + {-0.0025321396391918614, 0.001048846580346495}, + {-0.0025321396391918614, -0.001048846580346495} + } + },{ + "geos_e", + "+proj=geos +ellps=GRS80 +lat_1=0.5 +lat_2=2 +h=35785831", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222527.07036580026, 110551.30341332949}, + { 222527.07036580026, -110551.30341332949}, + {-222527.07036580026, 110551.30341332949}, + {-222527.07036580026, -110551.30341332949} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305689715385, 0.00090436947723267452}, + { 0.0017966305689715385, -0.00090436947723267452}, + {-0.0017966305689715385, 0.00090436947723267452}, + {-0.0017966305689715385, -0.00090436947723267452} + } + },{ + "geos_s", + "+proj=geos +R=6400000 +lat_1=0.5 +lat_2=2 +h=35785831", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223289.45763579503, 111677.65745653701}, + { 223289.45763579503, -111677.65745653701}, + {-223289.45763579503, 111677.65745653701}, + {-223289.45763579503, -111677.65745653701} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931105078943, 0.00089524655504237148}, + { 0.0017904931105078943, -0.00089524655504237148}, + {-0.0017904931105078943, 0.00089524655504237148}, + {-0.0017904931105078943, -0.00089524655504237148} + } + },{ + "gins8", + "+proj=gins8 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 194350.25093959007, 111703.90763533533}, + { 194350.25093959007, -111703.90763533533}, + {-194350.25093959007, 111703.90763533533}, + {-194350.25093959007, -111703.90763533533} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "sinu_e", + "+proj=sinu +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.29953946592, 110574.38855415257}, + { 222605.29953946592, -110574.38855415257}, + {-222605.29953946592, 110574.38855415257}, + {-222605.29953946592, -110574.38855415257} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305684613522, 0.00090436947707945409}, + { 0.0017966305684613522, -0.00090436947707945409}, + {-0.0017966305684613522, 0.00090436947707945409}, + {-0.0017966305684613522, -0.00090436947707945409} + } + },{ + "sinu_s", + "+proj=sinu +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.11902663155, 111701.07212763709}, + { 223368.11902663155, -111701.07212763709}, + {-223368.11902663155, 111701.07212763709}, + {-223368.11902663155, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.00089524655489191132}, + { 0.0017904931100023887, -0.00089524655489191132}, + {-0.0017904931100023887, 0.00089524655489191132}, + {-0.0017904931100023887, -0.00089524655489191132} + } + },{ + "eck6", + "+proj=eck6 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 197021.60562899226, 126640.42073317352}, + { 197021.60562899226, -126640.42073317352}, + {-197021.60562899226, 126640.42073317352}, + {-197021.60562899226, -126640.42073317352} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002029978749734037, 0.00078963032910382171}, + { 0.002029978749734037, -0.00078963032910382171}, + {-0.002029978749734037, 0.00078963032910382171}, + {-0.002029978749734037, -0.00078963032910382171} + } + },{ + "mbtfps", + "+proj=mbtfps +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 204740.11747857218, 121864.72971934026}, + { 204740.11747857218, -121864.72971934026}, + {-204740.11747857218, 121864.72971934026}, + {-204740.11747857218, -121864.72971934026} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019534152166442065, 0.00082057965689633387}, + { 0.0019534152166442065, -0.00082057965689633387}, + {-0.0019534152166442065, 0.00082057965689633387}, + {-0.0019534152166442065, -0.00082057965689633387} + } + },{ + "gn_sinu", + "+proj=gn_sinu +a=6400000 +lat_1=0.5 +lat_2=2 +m=1 +n=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.13250469571, 111698.23644718733}, + { 223385.13250469571, -111698.23644718733}, + {-223385.13250469571, 111698.23644718733}, + {-223385.13250469571, -111698.23644718733} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931098931057, 0.00089524655491012516}, + { 0.0017904931098931057, -0.00089524655491012516}, + {-0.0017904931098931057, 0.00089524655491012516}, + {-0.0017904931098931057, -0.00089524655491012516} + } + },{ + "gnom", + "+proj=gnom +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223492.92474718543, 111780.50920659291}, + { 223492.92474718543, -111780.50920659291}, + {-223492.92474718543, 111780.50920659291}, + {-223492.92474718543, -111780.50920659291} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931092009798, 0.00089524655438192376}, + { 0.0017904931092009798, -0.00089524655438192376}, + {-0.0017904931092009798, 0.00089524655438192376}, + {-0.0017904931092009798, -0.00089524655438192376} + } + },{ + "goode", + "+proj=goode +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.11902663155, 111701.07212763709}, + { 223368.11902663155, -111701.07212763709}, + {-223368.11902663155, 111701.07212763709}, + {-223368.11902663155, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.00089524655489191132}, + { 0.0017904931100023887, -0.00089524655489191132}, + {-0.0017904931100023887, 0.00089524655489191132}, + {-0.0017904931100023887, -0.00089524655489191132} + } + },{ + "gstmerc", + "+proj=gstmerc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223413.46640632182, 111769.14504058557}, + { 223413.46640632182, -111769.14504058668}, + {-223413.46640632302, 111769.14504058557}, + {-223413.46640632302, -111769.14504058668} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097109673, 0.0008952465544509083}, + { 0.0017904931097109673, -0.0008952465544509083}, + {-0.0017904931097109673, 0.0008952465544509083}, + {-0.0017904931097109673, -0.0008952465544509083} + } + },{ + "hammer", + "+proj=hammer +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223373.78870324057, 111703.90739776699}, + { 223373.78870324057, -111703.90739776699}, + {-223373.78870324057, 111703.90739776699}, + {-223373.78870324057, -111703.90739776699} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493109965961, 0.00089524655487369749}, + { 0.001790493109965961, -0.00089524655487369749}, + {-0.001790493109965961, 0.00089524655487369749}, + {-0.001790493109965961, -0.00089524655487369749} + } + },{ + "hatano", + "+proj=hatano +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 189878.87894652804, 131409.8024406255 }, + { 189881.08195244463, -131409.14227607418 }, + {-189878.87894652804, 131409.8024406255 }, + {-189881.08195244463, -131409.14227607418 } + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0021064624821817597, 0.00076095689425791926 }, + { 0.0021064624821676096, -0.00076095777439265377 }, + {-0.0021064624821817597, 0.00076095689425791926 }, + {-0.0021064624821676096, -0.00076095777439265377 } + } + },{ + "healpix_e", + "+proj=healpix +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222390.10394923863, 130406.58866448226}, + { 222390.10394923863, -130406.58866448054}, + {-222390.10394923863, 130406.58866448226}, + {-222390.10394923863, -130406.58866448054} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017986411845524453, 0.00076679453057823619}, + { 0.0017986411845524453, -0.00076679453057823619}, + {-0.0017986411845524453, 0.00076679453057823619}, + {-0.0017986411845524453, -0.00076679453057823619} + } + },{ + "healpix_s", + "+proj=healpix +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.14425527418, 131588.04444199943}, + { 223402.14425527418, -131588.04444199943}, + {-223402.14425527418, 131588.04444199943}, + {-223402.14425527418, -131588.04444199943} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097838226, 0.00075990887733981202}, + { 0.0017904931097838226, -0.00075990887733981202}, + {-0.0017904931097838226, 0.00075990887733981202}, + {-0.0017904931097838226, -0.00075990887733981202} + } + },{ + "rhealpix_e", + "+proj=rhealpix +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222390.10394923863, 130406.58866448226}, + { 222390.10394923863, -130406.58866448054}, + {-222390.10394923863, 130406.58866448226}, + {-222390.10394923863, -130406.58866448054} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017986411845524453, 0.00076679453057823619}, + { 0.0017986411845524453, -0.00076679453057823619}, + {-0.0017986411845524453, 0.00076679453057823619}, + {-0.0017986411845524453, -0.00076679453057823619} + } + },{ + "rhealpix_s", + "+proj=rhealpix +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.14425527418, 131588.04444199943}, + { 223402.14425527418, -131588.04444199943}, + {-223402.14425527418, 131588.04444199943}, + {-223402.14425527418, -131588.04444199943} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097838226, 0.00075990887733981202}, + { 0.0017904931097838226, -0.00075990887733981202}, + {-0.0017904931097838226, 0.00075990887733981202}, + {-0.0017904931097838226, -0.00075990887733981202} + } + }, + // helmert projection is not implemented in Boost.Geometry + // hgridshift projection is not implemented in Boost.Geometry + // horner projection is not implemented in Boost.Geometry + { + "igh", + "+proj=igh +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ { 223878.49745627123, 111701.07212763709}, + { 223708.37131305804, -111701.07212763709}, + {-222857.74059699223, 111701.07212763709}, + {-223027.86674020503, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ { 0.001790489447892545, 0.00089524655489191132}, + { 0.0017904906685957927, -0.00089524655489191132}, + {-0.001790496772112032, 0.00089524655489191132}, + {-0.0017904955514087843, -0.00089524655489191132} + } + },{ + "imw_p", + "+proj=imw_p +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222588.4411393762, 55321.128653809537}, + { 222756.90637768712, -165827.58428832365}, + {-222588.4411393762, 55321.128653809537}, + {-222756.90637768712, -165827.58428832365} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966991379592214, 0.50090492361427374}, + { 0.0017966979081574697, 0.49909507588689922}, + {-0.0017966991379592214, 0.50090492361427374}, + {-0.0017966979081574697, 0.49909507588689922} + } + },{ + "isea", + "+proj=isea +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-1097074.9480224741, 3442909.3090371834}, + {-1097074.9482647954, 3233611.7285857084}, + {-1575486.3536415542, 3442168.3420281881}, + {-1575486.353880283, 3234352.6955947056} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "krovak", + "+proj=krovak +ellps=GRS80 +no_defs", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-3196535.2325636409, -6617878.8675514441}, + {-3260035.4405521089, -6898873.6148780314}, + {-3756305.3288691747, -6478142.5615715114}, + {-3831703.6585019818, -6759107.1701553948} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {24.836218918719162, 59.758403933233858}, + {24.836315484509566, 59.756888425730189}, + {24.830447747947495, 59.758403933233858}, + {24.830351182157091, 59.756888425730189} + } + },{ + "labrd", + "+proj=labrd +ellps=GRS80 +lon_0=0.5 +lat_0=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 166973.166090228391, -110536.912730266107}, + { 166973.168287157256, -331761.993650884193}, + {-278345.500519976194, -110469.032642031714}, + {-278345.504185269645, -331829.870790275279} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.501797719349373672, 2.00090435742047923}, + {0.501797717380853658, 1.99909564058898681}, + {0.498202280650626328, 2.00090435742047923}, + {0.498202282619146342, 1.99909564058898681} + } + },{ + "laea_e", + "+proj=laea +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222602.471450095181, 110589.82722441027}, + { 222602.471450095181, -110589.827224408786}, + {-222602.471450095181, 110589.82722441027}, + {-222602.471450095181, -110589.827224408786} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056847900867, 0.000904369475966495845}, + { 0.00179663056847900867, -0.000904369475966495845}, + {-0.00179663056847900867, 0.000904369475966495845}, + {-0.00179663056847900867, -0.000904369475966495845} + } + },{ + "laea_s", + "+proj=laea +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223365.281370124663, 111716.668072915665}, + { 223365.281370124663, -111716.668072915665}, + {-223365.281370124663, 111716.668072915665}, + {-223365.281370124663, -111716.668072915665} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049311002060264, 0.000895246554791735271}, + { 0.00179049311002060264, -0.000895246554791735271}, + {-0.00179049311002060264, 0.000895246554791735271}, + {-0.00179049311002060264, -0.000895246554791735271} + } + },{ + "lagrng", + "+proj=lagrng +a=6400000 +W=2 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 111703.37591722561, 27929.8319080333386}, + { 111699.122088816002, -83784.1780133577704}, + {-111703.37591722561, 27929.8319080333386}, + {-111699.122088816002, -83784.1780133577704} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "larr", + "+proj=larr +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223393.637624200899, 111707.215961255497}, + {223393.637624200899, -111707.215961255497}, + {-223393.637624200899, 111707.215961255497}, + {-223393.637624200899, -111707.215961255497} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "lask", + "+proj=lask +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 217928.275907355128, 112144.32922014239}, + { 217928.275907355128, -112144.32922014239}, + {-217928.275907355128, 112144.32922014239}, + {-217928.275907355128, -112144.32922014239} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "lcc", + "+proj=lcc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222588.439735968423, 110660.533870799671}, + { 222756.879700278747, -110532.797660827026}, + {-222588.439735968423, 110660.533870799671}, + {-222756.879700278747, -110532.797660827026} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179635940600536667, 0.000904232207322381741}, + { 0.00179635817735249777, -0.000904233135128348995}, + {-0.00179635940600536667, 0.000904232207322381741}, + {-0.00179635817735249777, -0.000904233135128348995} + } + },{ + "lcca", + "+proj=lcca +ellps=GRS80 +lat_0=1 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.285770237417, 67.8060072715846616}, + { 222740.037637936533, -221125.539829601563}, + {-222605.285770237417, 67.8060072715846616}, + {-222740.037637936533, -221125.539829601563} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179690290525662526, 1.00090436621350798}, + { 0.00179690192174008037, 0.999095632791497268}, + {-0.00179690290525662526, 1.00090436621350798}, + {-0.00179690192174008037, 0.999095632791497268} + } + },{ + "loxim", + "+proj=loxim +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223382.295791338867, 55850.5360638185448}, + { 223393.637462243292, -167551.608191455656}, + {-223382.295791338867, 55850.5360638185448}, + {-223393.637462243292, -167551.608191455656} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179056141104335601, 0.500895246554891926}, + { 0.00179056116683692576, 0.499104753445108074}, + {-0.00179056141104335601, 0.500895246554891926}, + {-0.00179056116683692576, 0.499104753445108074} + } + },{ + "lsat", + "+proj=lsat +ellps=GRS80 +lat_1=0.5 +lat_2=2 +lsat=1 +path=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {18241950.01455855, 9998256.83982293494}, + {18746856.2533194572, 10215761.669925211}, + {18565503.6836331636, 9085039.14672705345}, + {19019696.9020289108, 9247763.0394328218} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {126.000423834530011, 0.00172378224025701425}, + {126.002213738256714, 0.00188015467480917966}, + {126.000734468914601, -0.00188015467480917966}, + {126.002524372641304, -0.00172378224025701425} + } + }, { + "mbt_fps", + "+proj=mbt_fps +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 198798.176129849948, 125512.017254530627}, + { 198798.176129849948, -125512.017254530627}, + {-198798.176129849948, 125512.017254530627}, + {-198798.176129849948, -125512.017254530627} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00201197086238270742, 0.000796711850174446003}, + { 0.00201197086238270742, -0.000796711850174446003}, + {-0.00201197086238270742, 0.000796711850174446003}, + {-0.00201197086238270742, -0.000796711850174446003} + } + },{ + "mbtfpp", + "+proj=mbtfpp +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {206804.786929820373, 120649.762565792524}, + {206804.786929820373, -120649.762565792524}, + {-206804.786929820373, 120649.762565792524}, + {-206804.786929820373, -120649.762565792524} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00193395359462902698, 0.00082883725477665357}, + {0.00193395359462902698, -0.00082883725477665357}, + {-0.00193395359462902698, 0.00082883725477665357}, + {-0.00193395359462902698, -0.00082883725477665357} + } + },{ + "mbtfpq", + "+proj=mbtfpq +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 209391.854738393013, 119161.040199054827}, + { 209391.854738393013, -119161.040199054827}, + {-209391.854738393013, 119161.040199054827}, + {-209391.854738393013, -119161.040199054827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00191010555824111571, 0.000839185447792341723}, + { 0.00191010555824111571, -0.000839185447792341723}, + {-0.00191010555824111571, 0.000839185447792341723}, + {-0.00191010555824111571, -0.000839185447792341723} + } + },{ + "merc_e", + "+proj=merc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222638.981586547132, 110579.965218249708}, + { 222638.981586547132, -110579.965218249112}, + {-222638.981586547132, 110579.965218249708}, + {-222638.981586547132, -110579.965218249112} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056823904264, 0.00090436947522799056}, + { 0.00179663056823904264, -0.00090436947522799056}, + {-0.00179663056823904264, 0.00090436947522799056}, + {-0.00179663056823904264, -0.00090436947522799056} + } + },{ + "merc_s", + "+proj=merc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111706.743574944077}, + { 223402.144255274179, -111706.743574944485}, + {-223402.144255274179, 111706.743574944077}, + {-223402.144255274179, -111706.743574944485} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554845297135}, + { 0.00179049310978382265, -0.000895246554858019272}, + {-0.00179049310978382265, 0.000895246554845297135}, + {-0.00179049310978382265, -0.000895246554858019272} + } + },{ + "mill", + "+proj=mill +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111704.701754393827}, + { 223402.144255274179, -111704.701754396243}, + {-223402.144255274179, 111704.701754393827}, + {-223402.144255274179, -111704.701754396243} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554873922024}, + { 0.00179049310978382265, -0.000895246554873922024}, + {-0.00179049310978382265, 0.000895246554873922024}, + {-0.00179049310978382265, -0.000895246554873922024} + } + }, + // the following projections are not implemented in Boost.Geometry + /*{ + "misrsom_e", + "+proj=misrsom +ellps=GRS80 +lat_1=0.5 +lat_2=2 +path=1", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {18556630.3683698252, 9533394.6753112711}, + {19041866.0067297369, 9707182.17532352544}, + {18816810.1301847994, 8647669.64980295487}, + {19252610.7845367305, 8778164.08580140397} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {127.759503987730625, 0.00173515039622462014}, + {127.761295471077958, 0.00187196632421706517}, + {127.759775773557251, -0.00187196632421891525}, + {127.76156725690457, -0.00173515039622462014} + } + },{ + "misrsom_s", + "+proj=misrsom +R=6400000 +lat_1=0.5 +lat_2=2 +path=1", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {18641249.2791703865, 9563342.53233416565}, + {19130982.4615812786, 9739539.59350463562}, + {18903483.5150115378, 8675064.50061797537}, + {19343388.3998006098, 8807471.90406848863} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {127.75950514818588, 0.00171623111593511971}, + {127.761290323778738, 0.00185412132880796244}, + {127.759780920856471, -0.00185412132880796244}, + {127.761566096449329, -0.00171623111593511971} + } + },{ + "mil_os", + "+proj=mil_os +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-1908527.94959420455, -1726237.4730614475}, + {-1916673.02291848511, -1943133.88812552323}, + {-2344429.41208962305, -1706258.05121891224}, + {-2354637.83553299867, -1926468.60513541684} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {20.0020363939492398, 18.0009683469140498}, + {20.0020363715837419, 17.999031631815086}, + {19.9979636060507602, 18.0009683469140498}, + {19.9979636284162581, 17.999031631815086} + } + },{ + "lee_os", + "+proj=lee_os +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-25564478.9526050538, 154490848.8286255}, + { 30115393.9385746419, 125193997.439701974}, + {-31039340.5921660066, 57678685.0448915437}, + {-3088419.93942357088, 58150091.0991110131} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-164.997479457813824, -9.99875886103541411}, + {-164.997479438558884, -10.0012411200022751}, + {-165.002520542186289, -9.99875886103545142}, + {-165.002520561440946, -10.0012411200022999} + } + },{ + "gs48", + "+proj=gs48 +R=6370997", + // All latitudes and longitudes within the continental US + { + { -119.0, 40.0}, + { -70.0, 64.0}, + { -80.0, 25.0}, + { -95.0, 35.0} + },{ + { -1923908.446529345820, 355874.658944479190}, + { 1354020.375109298155, 3040846.007866524626}, + { 1625139.160484319553, -1413614.894029108109}, + { 90241.658071457961, -439595.048485902138} + },{ + { -1923000.0, 355000.0}, + { 1354000.0, 3040000.0}, + { 1625000.0, -1413000.0}, + { 90000.0, -439000.0} + },{ + {-118.987112613284, 39.994449789388}, + { -70.005208999424, 63.993387835525}, + { -80.000346610440, 25.005602546594}, + { -95.002606473071, 35.005424705030} + } + },{ + "alsk_e", + "+proj=alsk +ellps=clrk66", + { + {-160.0, 55.0}, + {-160.0, 70.0}, + {-145.0, 70.0}, + {-145.0, 60.0} + },{ + {-513253.146950842060, -968928.031867943470}, + {-305001.133897637190, 687494.464958650530}, + {266454.305088600490, 683423.477493030950}, + {389141.322439243960, -423913.251230396680} + },{ + {-500000.0, -950000.0}, + {-305000.0, 700000.0}, + { 250000.0, 700000.0}, + { 400000.0, -400000.0} + },{ + {-159.830804302926, 55.183195262220}, + {-160.042203155537, 70.111086864056}, + {-145.381043551466, 70.163900908411}, + {-144.758985461448, 60.202929200739} + } + },{ + "alsk_s", + "+proj=alsk +R=6370997", + { + {-160.0, 55.0}, + {-160.0, 70.0}, + {-145.0, 70.0}, + {-145.0, 60.0} + },{ + {-511510.319410844070, -967150.991676078060}, + {-303744.771290368980, 685439.745941123230}, + {265354.974019662940, 681386.892874573010}, + {387711.995394026630, -422980.685505462640} + },{ + {-500000.0, -950000.0}, + {-305000.0, 700000.0}, + { 250000.0, 700000.0}, + { 400000.0, -400000.0} + },{ + {-159.854014457557, 55.165653849074}, + {-160.082332371601, 70.128307617632}, + {-145.347827407243, 70.181566919011}, + {-144.734239827146, 60.193564732505} + } + },{ + "gs50_e", + "+proj=gs50 +ellps=clrk66", + { + {-160.0, 65.0}, + {-130.0, 45.0}, + { -65.0, 45.0}, + { -80.0, 36.0} + },{ + {-1874628.5377402329, 2660907.942291015300}, + { -771831.51885333552, 48465.166491304852}, + { 4030931.8339815089, 1323687.864777399200}, + { 3450764.2615361013, -175619.041820732440} + },{ + {-1800000.0, 2600000.0}, + { -800000.0, 500000.0}, + { 4000000.0, 1300000.0}, + { 3900000.0, -170000.0} + },{ + {-157.989284999679, 64.851559609698}, + {-131.171390466814, 49.084969745967}, + { -65.491568685301, 44.992837923774}, + { -75.550660091101, 34.191114075743} + } + },{ + "gs50_s", + "+proj=gs50 +R=6370997", + { + {-160.0, 65.0}, + {-130.0, 45.0}, + { -65.0, 45.0}, + { -80.0, 36.0} + },{ + {-1867268.2534600089, 2656506.230401823300}, + { -769572.18967299373, 48324.312440863941}, + { 4019393.068680791200, 1320191.309350289200}, + { 3442685.615172345700, -178760.423489428680} + },{ + {-1800000.0, 2600000.0}, + { -800000.0, 500000.0}, + { 4000000.0, 1300000.0}, + { 3900000.0, -170000.0} + },{ + {-158.163295044933, 64.854288364994}, + {-131.206816959506, 49.082915350974}, + { -65.348945220767, 44.957292681774}, + { -75.446820242089, 34.185406225616} + } + },*/ + { + "moll", + "+proj=moll +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {201113.698641813244, 124066.283433859542}, + {201113.698641813244, -124066.283433859542}, + {-201113.698641813244, 124066.283433859542}, + {-201113.698641813244, -124066.283433859542} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00198873782220854774, 0.000806005080362811612}, + {0.00198873782220854774, -0.000806005080362811612}, + {-0.00198873782220854774, 0.000806005080362811612}, + {-0.00198873782220854774, -0.000806005080362811612} + } + },{ + "wag4", + "+proj=wag4 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 192801.218662384286, 129416.216394802992}, + { 192801.218662384286, -129416.216394802992}, + {-192801.218662384286, 129416.216394802992}, + {-192801.218662384286, -129416.216394802992} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00207450259783523421, 0.000772682950537716476}, + { 0.00207450259783523421, -0.000772682950537716476}, + {-0.00207450259783523421, 0.000772682950537716476}, + {-0.00207450259783523421, -0.000772682950537716476} + } + },{ + "wag5", + "+proj=wag5 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 203227.05192532466, 138651.631442713202}, + { 203227.05192532466, -138651.631442713202}, + {-203227.05192532466, 138651.631442713202}, + {-203227.05192532466, -138651.631442713202} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00196807227086416396, 0.00072121615041701424}, + { 0.00196807227086416396, -0.00072121615041701424}, + {-0.00196807227086416396, 0.00072121615041701424}, + {-0.00196807227086416396, -0.00072121615041701424} + } + },{ + "natearth", + "+proj=natearth +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 194507.265257889288, 112508.737358294515}, + { 194507.265257889288, -112508.737358294515}, + {-194507.265257889288, 112508.737358294515}, + {-194507.265257889288, -112508.737358294515} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00205638349586440223, 0.000888823913291242177}, + { 0.00205638349586440223, -0.000888823913291242177}, + {-0.00205638349586440223, 0.000888823913291242177}, + {-0.00205638349586440223, -0.000888823913291242177} + } + }, + // the following projection is not implemented in Boost.Geometry + /*{ + "natearth2", + "+proj=natearth2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 189255.172934730799, 113022.495810907014}, + { 189255.172934730799, -113022.495810907014}, + {-189255.172934730799, 113022.495810907014}, + {-189255.172934730799, -113022.495810907014} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00211344929691056112, 0.000884779612080993237}, + { 0.00211344929691056112, -0.000884779612080993237}, + {-0.00211344929691056112, 0.000884779612080993237}, + {-0.00211344929691056112, -0.000884779612080993237} + } + },*/ + { + "nell", + "+proj=nell +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.132504695706, 111698.23644718733}, + { 223385.132504695706, -111698.23644718733}, + {-223385.132504695706, 111698.23644718733}, + {-223385.132504695706, -111698.23644718733} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310989310567, 0.000895246554910125161}, + { 0.00179049310989310567, -0.000895246554910125161}, + {-0.00179049310989310567, 0.000895246554910125161}, + {-0.00179049310989310567, -0.000895246554910125161} + } + },{ + "nell_h", + "+proj=nell_h +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.131640952837, 111698.236533561678}, + { 223385.131640952837, -111698.236533561678}, + {-223385.131640952837, 111698.236533561678}, + {-223385.131640952837, -111698.236533561678} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310989310567, 0.000895246554910125378}, + { 0.00179049310989310567, -0.000895246554910125378}, + {-0.00179049310989310567, 0.000895246554910125378}, + {-0.00179049310989310567, -0.000895246554910125378} + } + },{ + "nicol", + "+proj=nicol +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.561814139714, 111732.553988545071}, + { 223374.561814139714, -111732.553988545071}, + {-223374.561814139714, 111732.553988545071}, + {-223374.561814139714, -111732.553988545071} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "nsper", + "+proj=nsper +a=6400000 +h=1000000", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222239.816114099842, 111153.763991924759}, + { 222239.816114099842, -111153.763991924759}, + {-222239.816114099842, 111153.763991924759}, + {-222239.816114099842, -111153.763991924759} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049311728792437, 0.000895246558425396135}, + { 0.00179049311728792437, -0.000895246558425396135}, + {-0.00179049311728792437, 0.000895246558425396135}, + {-0.00179049311728792437, -0.000895246558425396135} + } + },{ + "tpers", + "+proj=tpers +a=6400000 +h=1000000 +azi=20", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 170820.288955531199, 180460.865555804776}, + { 246853.941538942483, -28439.8780357754222}, + {-246853.941538942483, 28439.8780357754222}, + {-170820.288955531199, -180460.865555804776} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00198870552603137678, 0.000228871872278689991}, + { 0.00137632081376749859, -0.00145364129728205432}, + {-0.00137632081376749859, 0.00145364129728205432}, + {-0.00198870552603137678, -0.000228871872278689991} + } + },{ + "nzmg", + "+proj=nzmg +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {3352675144.74742508, -7043205391.10024357}, + {3691989502.77930641, -6729069415.33210468}, + {4099000768.45323849, -7863208779.66724873}, + {4466166927.36997604, -7502531736.62860489} + },{ + { 200000, 100000}, + { 200000,-100000}, + {-200000, 100000}, + {-200000,-100000} + },{ + {175.48208682711271, -69.4226921826331846}, + {175.756819472543611, -69.5335710883796168}, + {134.605119233460016, -61.4599957106629091}, + {134.333684315954827, -61.6215536756024349} + } + },{ + "ob_tran", + "+proj=ob_tran +a=6400000 +o_proj=latlon +o_lon_p=20 +o_lat_p=20 +lon_0=180", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-2.6856872138416592, 1.2374302350496296}, + {-2.6954069748943286, 1.2026833954513816}, + {-2.8993663925401947, 1.2374302350496296}, + {-2.8896466314875244, 1.2026833954513816} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 121.5518748407577, -2.5361001573966084}, + { 63.261184340201858, 17.585319578673531}, + {-141.10073322351622, 26.091712304855108}, + {-65.862385598848391, 51.830295078417215} + } + },{ + "ocea", + "+proj=ocea +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {19994423.837934087962, 223322.760576727800}, + {20217962.128015257418, 223322.760576729401}, + {19994423.837934091687, -223322.760576726549}, + {20217962.128015264869, -223322.760576724948}, + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 179.999104753445, 0.001790493110}, + {-179.999104753445, 0.001790493110}, + { 179.999104753445, -0.001790493110}, + {-179.999104753445, -0.001790493110} + } + },{ + "oea", + "+proj=oea +a=6400000 +lat_1=0.5 +lat_2=2 +n=1 +m=2 +theta=3", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 228926.872097864107, 99870.4884300760023}, + { 217242.584036940476, -123247.885607474513}, + {-217242.584036940476, 123247.885607474556}, + {-228926.872097864078, -99870.4884300760168} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017411857167771369, 0.000987726819566195693}, + { 0.00183489288577854998, -0.000800312481495174641}, + {-0.00183489288577854954, 0.000800312481495174966}, + {-0.00174118571677713712, -0.000987726819566195043} + } + },{ + "omerc", + "+proj=omerc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222650.796885261341, 110642.229314983808}, + { 222650.796885261341, -110642.229314983808}, + {-222650.796885261545, 110642.229314983808}, + {-222650.796885261545, -110642.229314983808} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056816996357, 0.000904369474808157338}, + { 0.00179663056816996357, -0.000904369474820879583}, + {-0.0017966305681604536, 0.000904369474808157338}, + {-0.0017966305681604536, -0.000904369474820879583} + } + },{ + "ortho", + "+proj=ortho +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223322.76057672748, 111695.401198614476}, + { 223322.76057672748, -111695.401198614476}, + {-223322.76057672748, 111695.401198614476}, + {-223322.76057672748, -111695.401198614476} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931102938101, 0.000895246554928338998}, + { 0.0017904931102938101, -0.000895246554928338998}, + {-0.0017904931102938101, 0.000895246554928338998}, + {-0.0017904931102938101, -0.000895246554928338998} + } + }, + // patterson projection is not implemented in Boost.Geometry + /*{ + "patterson", + "+proj=patterson +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.144255274179, 113354.250397779804}, + {223402.144255274179, -113354.250397779804}, + {-223402.144255274179, 113354.250397779804}, + {-223402.144255274179, -113354.250397779804} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00179049310978382265, 0.000882190140807953657}, + {0.00179049310978382265, -0.000882190140807953657}, + {-0.00179049310978382265, 0.000882190140807953657}, + {-0.00179049310978382265, -0.000882190140807953657} + } + },*/ + // pipeline projection is not implemented in Boost.Geometry + // and tests are implemented differently + { + "poly_e", + "+proj=poly +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.285770237475, 110642.194561440483}, + { 222605.285770237475, -110642.194561440483}, + {-222605.285770237475, 110642.194561440483}, + {-222605.285770237475, -110642.194561440483} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056846135222, 0.000904369476631838518}, + { 0.00179663056846135222, -0.000904369476631838518}, + {-0.00179663056846135222, 0.000904369476631838518}, + {-0.00179663056846135222, -0.000904369476631838518} + } + },{ + "poly_s", + "+proj=poly +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.105210218986, 111769.110491224754}, + { 223368.105210218986, -111769.110491224754}, + {-223368.105210218986, 111769.110491224754}, + {-223368.105210218986, -111769.110491224754} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.000895246554454779222}, + { 0.0017904931100023887, -0.000895246554454779222}, + {-0.0017904931100023887, 0.000895246554454779222}, + {-0.0017904931100023887, -0.000895246554454779222} + } + },{ + "putp2", + "+proj=putp2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 211638.039634339279, 117895.033043379764}, + { 211638.039634339279, -117895.033043379764}, + {-211638.039634339279, 117895.033043379764}, + {-211638.039634339279, -117895.033043379764} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00188980221640386672, 0.000848201580276863377}, + { 0.00188980221640386672, -0.000848201580276863377}, + {-0.00188980221640386672, 0.000848201580276863377}, + {-0.00188980221640386672, -0.000848201580276863377} + } + },{ + "putp3", + "+proj=putp3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 178227.115507793525, 89124.5607860879827}, + { 178227.115507793525, -89124.5607860879827}, + {-178227.115507793525, 89124.5607860879827}, + {-178227.115507793525, -89124.5607860879827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00224405032986489889, 0.00112202516475805899}, + { 0.00224405032986489889, -0.00112202516475805899}, + {-0.00224405032986489889, 0.00112202516475805899}, + {-0.00224405032986489889, -0.00112202516475805899} + } + },{ + "putp3p", + "+proj=putp3p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 178238.118539984745, 89124.5607860879827}, + { 178238.118539984745, -89124.5607860879827}, + {-178238.118539984745, 89124.5607860879827}, + {-178238.118539984745, -89124.5607860879827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00224405032969050844, 0.00112202516475805899}, + { 0.00224405032969050844, -0.00112202516475805899}, + {-0.00224405032969050844, 0.00112202516475805899}, + {-0.00224405032969050844, -0.00112202516475805899} + } + },{ + "putp4p", + "+proj=putp4p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 195241.47734938623, 127796.782307926231}, + { 195241.47734938623, -127796.782307926231}, + {-195241.47734938623, 127796.782307926231}, + {-195241.47734938623, -127796.782307926231} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00204852830860296001, 0.000782480174932193733}, + { 0.00204852830860296001, -0.000782480174932193733}, + {-0.00204852830860296001, 0.000782480174932193733}, + {-0.00204852830860296001, -0.000782480174932193733} + } + },{ + "weren", + "+proj=weren +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223378.515757633519, 146214.093042288267}, + { 223378.515757633519, -146214.093042288267}, + {-223378.515757633519, 146214.093042288267}, + {-223378.515757633519, -146214.093042288267} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310987240413, 0.000683917989676492265}, + { 0.00179049310987240413, -0.000683917989676492265}, + {-0.00179049310987240413, 0.000683917989676492265}, + {-0.00179049310987240413, -0.000683917989676492265} + } + },{ + "putp5", + "+proj=putp5 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 226367.21338056153, 113204.56855847509}, + { 226367.21338056153, -113204.56855847509}, + {-226367.21338056153, 113204.56855847509}, + {-226367.21338056153, -113204.56855847509} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00176671315102969553, 0.000883356575387199546}, + { 0.00176671315102969553, -0.000883356575387199546}, + {-0.00176671315102969553, 0.000883356575387199546}, + {-0.00176671315102969553, -0.000883356575387199546} + } + },{ + "putp5p", + "+proj=putp5p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 226388.175248755841, 113204.56855847509}, + { 226388.175248755841, -113204.56855847509}, + {-226388.175248755841, 113204.56855847509}, + {-226388.175248755841, -113204.56855847509} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00176671315090204742, 0.000883356575387199546}, + { 0.00176671315090204742, -0.000883356575387199546}, + {-0.00176671315090204742, 0.000883356575387199546}, + {-0.00176671315090204742, -0.000883356575387199546} + } + },{ + "putp6", + "+proj=putp6 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 226369.395133402577, 110218.523796520662}, + { 226369.395133402577, -110218.523796520749}, + {-226369.395133402577, 110218.523796520662}, + {-226369.395133402577, -110218.523796520749} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00176671315102969921, 0.000907295534210503544}, + { 0.00176671315102969921, -0.000907295534205924308}, + {-0.00176671315102969921, 0.000907295534210503544}, + {-0.00176671315102969921, -0.000907295534205924308} + } + },{ + "putp6p", + "+proj=putp6p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 198034.195132195076, 125989.475461323193}, + { 198034.195132195076, -125989.475461323193}, + {-198034.195132195076, 125989.475461323193}, + {-198034.195132195076, -125989.475461323193} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00201955053120177067, 0.000793716441164738612}, + { 0.00201955053120177067, -0.000793716441164738612}, + {-0.00201955053120177067, 0.000793716441164738612}, + {-0.00201955053120177067, -0.000793716441164738612} + } + },{ + "qsc_e", + "+proj=qsc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 304638.450843852363, 164123.870923793991}, + { 304638.450843852363, -164123.870923793991}, + {-304638.450843852363, 164123.870923793962}, + {-304638.450843852421, -164123.870923793904} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00132134098471627126, 0.000610652900922527926}, + { 0.00132134098471627126, -0.000610652900922527926}, + {-0.00132134098471627126, 0.000610652900922527926}, + {-0.00132134098471627126, -0.000610652900922527926} + } + },{ + "qsc_s", + "+proj=qsc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 305863.792402890511, 165827.722754715243}, + { 305863.792402890511, -165827.722754715243}, + {-305863.792402890511, 165827.722754715243}, + {-305863.792402890569, -165827.722754715156} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00131682718763827234, 0.000604493198178676161}, + { 0.00131682718763827234, -0.000604493198178676161}, + {-0.00131682718763827234, 0.000604493198178676161}, + {-0.00131682718763827234, -0.000604493198178676161} + } + },{ + "robin", + "+proj=robin +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ // original expected different because float coefficients are defined + /*{ 189588.423282507836, 107318.530350702888}, + { 189588.423282507836, -107318.530350702888}, + {-189588.423282507836, 107318.530350702888}, + {-189588.423282507836, -107318.530350702888}*/ + { 189588.4232821252, 107318.5272684303}, + { 189588.4232821252, -107318.5272684303}, + {-189588.4232821252, 107318.5272684303}, + {-189588.4232821252, -107318.5272684303} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002109689065506131, 0.000931805533547745983}, + { 0.002109689065506131, -0.000931805533547745983}, + {-0.002109689065506131, 0.000931805533547745983}, + {-0.002109689065506131, -0.000931805533547745983} + } + },{ + "rpoly", + "+proj=rpoly +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.09830201423, 111769.110486991223}, + { 223368.09830201423, -111769.110486991223}, + {-223368.09830201423, 111769.110486991223}, + {-223368.09830201423, -111769.110486991223} + }, + {},{{HUGE_VAL, HUGE_VAL}} + }, + // sch projection not implemented in Boost.Geometry + // and the tests are not implemented in Proj4 anyway + { + "euler_e", + "+proj=euler +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222597.63465910763, 111404.24054991946}, + {222767.16563187627, -111234.6764910177}, + {-222597.63465910763, 111404.24054991946}, + {-222767.16563187627, -111234.6764910177} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962807023075235, 0.0008983146697688839}, + {0.0017962794738334226, -0.00089831589842987965}, + {-0.0017962807023075235, 0.0008983146697688839}, + {-0.0017962794738334226, -0.00089831589842987965} + } + },{ + "euler_s", + "+proj=euler +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223360.65559869423, 111786.11238979101}, + {223530.76769031584, -111615.96709862351}, + {-223360.65559869423, 111786.11238979101}, + {-223530.76769031584, -111615.96709862351} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901444369360026, 0.00089524594522202015}, + {0.001790143216840731, -0.00089524716533368484}, + {-0.0017901444369360026, 0.00089524594522202015}, + {-0.001790143216840731, -0.00089524716533368484} + } + },{ + "murd1_e", + "+proj=murd1 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222600.81347355421, 111404.24418054636}, + {222770.3492878644, -111234.6728566746}, + {-222600.81347355421, 111404.24418054636}, + {-222770.3492878644, -111234.6728566746} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962550410516366, 0.0008983146697688839}, + {0.0017962538125775522, -0.00089831589842987965}, + {-0.0017962550410516366, 0.0008983146697688839}, + {-0.0017962538125775522, -0.00089831589842987965} + } + },{ + "murd1_s", + "+proj=murd1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223363.84530949194, 111786.11603286299}, + {223533.96225925098, -111615.96345182261}, + {-223363.84530949194, 111786.11603286299}, + {-223533.96225925098, -111615.96345182261} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901188633413715, 0.00089524594522202015}, + {0.0017901176432461162, -0.00089524716492657387}, + {-0.0017901188633413715, 0.00089524594522202015}, + {-0.0017901176432461162, -0.00089524716492657387} + } + },{ + "murd2_e", + "+proj=murd2 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222588.09975123021, 111426.14002741246}, + {222757.72626701824, -111341.43131750476}, + {-222588.09975123021, 111426.14002741246}, + {-222757.72626701824, -111341.43131750476} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017963574947305447, 0.00089788747830845382}, + {0.0017963562661689487, -0.00089788809264252983}, + {-0.0017963574947305447, 0.00089788747830845382}, + {-0.0017963562661689487, -0.00089788809264252983} + } + },{ + "murd2_s", + "+proj=murd2 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223351.08800702673, 111808.08693438848}, + {223521.2959691704, -111723.08785967289}, + {-223351.08800702673, 111808.08693438848}, + {-223521.2959691704, -111723.08785967289} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017902209670287586, 0.00089482021163422854}, + {0.0017902197468465887, -0.00089482082161134206}, + {-0.0017902209670287586, 0.00089482021163422854}, + {-0.0017902197468465887, -0.00089482082161134206} + } + },{ + "murd3_e", + "+proj=murd3 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222600.81407757697, 111404.24660137216}, + {222770.35473389886, -111234.67043217793}, + {-222600.81407757697, 111404.24660137216}, + {-222770.35473389886, -111234.67043217793} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962550166583809, 0.0008983146697688839}, + {0.0017962537881492445, -0.00089831589842987965}, + {-0.0017962550166583809, 0.0008983146697688839}, + {-0.0017962537881492445, -0.00089831589842987965} + } + },{ + "murd3_s", + "+proj=murd3 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223363.84591558515, 111786.11846198692}, + {223533.96772395336, -111615.96101901523}, + {-223363.84591558515, 111786.11846198692}, + {-223533.96772395336, -111615.96101901523} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901188390313859, 0.00089524594522202015}, + {0.0017901176189013177, -0.00089524716533368484}, + {-0.0017901188390313859, 0.00089524594522202015}, + {-0.0017901176189013177, -0.00089524716533368484} + } + },{ + "pconic_e", + "+proj=pconic +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222588.09884161691, 111416.60477006658}, + {222757.71809109033, -111331.88153107995}, + {-222588.09884161691, 111416.60477006658}, + {-222757.71809109033, -111331.88153107995} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017963575313784969, 0.0008979644089172499}, + {0.0017963563027642206, -0.00089796502355327969}, + {-0.0017963575313784969, 0.0008979644089172499}, + {-0.0017963563027642206, -0.00089796502355327969} + } + },{ + "pconic_s", + "+proj=pconic +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223351.08709429545, 111798.5189920546}, + {223521.28776521701, -111713.50533845725}, + {-223351.08709429545, 111798.5189920546}, + {-223521.28776521701, -111713.50533845725} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017902210035514285, 0.0008948968793741558}, + {0.0017902197833169374, -0.00089489748965381963}, + {-0.0017902210035514285, 0.0008948968793741558}, + {-0.0017902197833169374, -0.00089489748965381963} + } + },{ + "tissot_e", + "+proj=tissot +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222641.07869963095, 54347.828487281469}, + {222810.61451394114, -168291.08854993948}, + {-222641.07869963095, 54347.828487281469}, + {-222810.61451394114, -168291.08854993948} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962807107425871, 0.51344495513064536}, + {0.0017962794822333915, 0.51164832456244658}, + {-0.0017962807107425871, 0.51344495513064536}, + {-0.0017962794822333915, 0.51164832456244658} + } + },{ + "tissot_s", + "+proj=tissot +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223404.24855684943, 54534.122161157939}, + {223574.36550660848, -168867.95732352766}, + {-223404.24855684943, 54534.122161157939}, + {-223574.36550660848, -168867.95732352766} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901444453421915, 0.51344188640609856}, + {0.001790143225212064, 0.51165139329554277}, + {-0.0017901444453421915, 0.51344188640609856}, + {-0.001790143225212064, 0.51165139329554277} + } + },{ + "vitk1_e", + "+proj=vitk1 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222607.17121145778, 111404.25144243463}, + {222776.71670959776, -111234.66558744459}, + {-222607.17121145778, 111404.25144243463}, + {-222776.71670959776, -111234.66558744459} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962037198570686, 0.0008983146697688839}, + {0.0017962024913830157, -0.00089831589842987965}, + {-0.0017962037198570686, 0.0008983146697688839}, + {-0.0017962024913830157, -0.00089831589842987965} + } + },{ + "vitk1_s", + "+proj=vitk1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223370.22484047143, 111786.12331964359}, + {223540.3515072545, -111615.9561576751}, + {-223370.22484047143, 111786.12331964359}, + {-223540.3515072545, -111615.9561576751} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017900677174648159, 0.00089524594522202015}, + {0.0017900664973695916, -0.00089524716533368484}, + {-0.0017900677174648159, 0.00089524594522202015}, + {-0.0017900664973695916, -0.00089524716533368484} + } + },{ + "somerc_e", + "+proj=somerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222638.98158654713, 110579.96521824898}, + {222638.98158654713, -110579.96521825089}, + {-222638.98158654713, 110579.96521824898}, + {-222638.98158654713, -110579.96521825089} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305682390426, 0.00090436947704129484}, + {0.0017966305682390426, -0.00090436947704377105}, + {-0.0017966305682390426, 0.00090436947704129484}, + {-0.0017966305682390426, -0.00090436947704377105} + } + },{ + "somerc_s", + "+proj=somerc +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.14425527418, 111706.74357494408}, + {223402.14425527418, -111706.74357494518}, + {-223402.14425527418, 111706.74357494408}, + {-223402.14425527418, -111706.74357494518} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931097838226, 0.00089524655485801927}, + {0.0017904931097838226, -0.00089524655484529714}, + {-0.0017904931097838226, 0.00089524655485801927}, + {-0.0017904931097838226, -0.00089524655484529714} + } + },{ + "stere_e", + "+proj=stere +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222644.8545501172, 110610.8834741739}, + { 222644.8545501172, -110610.8834741739}, + {-222644.8545501172, 110610.8834741739}, + {-222644.8545501172, -110610.8834741739} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305682022392, 0.00090436947502443507}, + { 0.0017966305682022392, -0.00090436947502443507}, + {-0.0017966305682022392, 0.00090436947502443507}, + {-0.0017966305682022392, -0.00090436947502443507} + } + },{ + "stere_s", + "+proj=stere +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223407.81025950745, 111737.938996443}, + { 223407.81025950745, -111737.938996443}, + {-223407.81025950745, 111737.938996443}, + {-223407.81025950745, -111737.938996443} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493109747395, 0.00089524655465513144}, + { 0.001790493109747395, -0.00089524655465513144}, + {-0.001790493109747395, 0.00089524655465513144}, + {-0.001790493109747395, -0.00089524655465513144} + } + },{ + "ups", + "+proj=ups +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {2433455.5634384668, -10412543.301512826}, + {2448749.1185681992, -10850493.419804076}, + {1566544.4365615332, -10412543.301512826}, + {1551250.8814318008, -10850493.419804076} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-44.998567498074834, 64.9182362867341}, + {-44.995702709112308, 64.917020250675748}, + {-45.004297076028529, 64.915804280954518}, + {-45.001432287066002, 64.914588377560719} + } + },{ + "sterea_e", + "+proj=sterea +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222644.89410919772, 110611.09187173686}, + { 222644.89410919772, -110611.09187173827}, + {-222644.89410919772, 110611.09187173686}, + {-222644.89410919772, -110611.09187173827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305682019911, 0.00090436947683099009}, + { 0.0017966305682019911, -0.00090436947684371233}, + {-0.0017966305682019911, 0.00090436947683099009}, + {-0.0017966305682019911, -0.00090436947684371233} + } + },{ + "sterea_s", + "+proj=sterea +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223407.81025950745, 111737.93899644315}, + { 223407.81025950745, -111737.93899644315}, + {-223407.81025950745, 111737.93899644315}, + {-223407.81025950745, -111737.93899644315} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493109747395, 0.00089524655465446378}, + { 0.001790493109747395, -0.00089524655465446378}, + {-0.001790493109747395, 0.00089524655465446378}, + {-0.001790493109747395, -0.00089524655465446378} + } + },{ + "fouc_e", + "+proj=fouc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222588.12067589167, 111322.31670069379}, + {222588.12067589167, -111322.31670069379}, + {-222588.12067589167, 111322.31670069379}, + {-222588.12067589167, -111322.31670069379} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305685702751, 0.00089831528410111959}, + {0.0017966305685702751, -0.00089831528410111959}, + {-0.0017966305685702751, 0.00089831528410111959}, + {-0.0017966305685702751, -0.00089831528410111959} + } + },{ + "fouc_s", + "+proj=fouc +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223351.10900341379, 111703.9077217125}, + {223351.10900341379, -111703.9077217125}, + {-223351.10900341379, 111703.9077217125}, + {-223351.10900341379, -111703.9077217125} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931101116717, 0.00089524655487369749}, + {0.0017904931101116717, -0.00089524655487369749}, + {-0.0017904931101116717, 0.00089524655487369749}, + {-0.0017904931101116717, -0.00089524655487369749} + } + },{ + "kav5_e", + "+proj=kav5 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {200360.90530882866, 123685.08247699818}, + {200360.90530882866, -123685.08247699818}, + {-200360.90530882866, 123685.08247699818}, + {-200360.90530882866, -123685.08247699818} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019962591348533314, 0.00080848256185253912}, + {0.0019962591348533314, -0.00080848256185253912}, + {-0.0019962591348533314, 0.00080848256185253912}, + {-0.0019962591348533314, -0.00080848256185253912} + } + },{ + "kav5_s", + "+proj=kav5 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {201047.7031108776, 124109.05062917093}, + {201047.7031108776, -124109.05062917093}, + {-201047.7031108776, 124109.05062917093}, + {-201047.7031108776, -124109.05062917093} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019894397264987643, 0.00080572070962591153}, + {0.0019894397264987643, -0.00080572070962591153}, + {-0.0019894397264987643, 0.00080572070962591153}, + {-0.0019894397264987643, -0.00080572070962591153} + } + },{ + "qua_aut_e", + "+proj=qua_aut +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222613.54903309655, 111318.07788798446}, + {222613.54903309655, -111318.07788798446}, + {-222613.54903309655, 111318.07788798446}, + {-222613.54903309655, -111318.07788798446} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305684046586, 0.00089831528412872229}, + {0.0017966305684046586, -0.00089831528412872229}, + {-0.0017966305684046586, 0.00089831528412872229}, + {-0.0017966305684046586, -0.00089831528412872229} + } + },{ + "qua_aut_s", + "+proj=qua_aut +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223376.62452402918, 111699.65437918637}, + {223376.62452402918, -111699.65437918637}, + {-223376.62452402918, 111699.65437918637}, + {-223376.62452402918, -111699.65437918637} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931099477471, 0.00089524655490101819}, + {0.0017904931099477471, -0.00089524655490101819}, + {-0.0017904931099477471, 0.00089524655490101819}, + {-0.0017904931099477471, -0.00089524655490101819} + } + },{ + "mbt_s_e", + "+proj=mbt_s +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {204131.51785027285, 121400.33022550763}, + {204131.51785027285, -121400.33022550763}, + {-204131.51785027285, 121400.33022550763}, + {-204131.51785027285, -121400.33022550763} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019593827209883237, 0.00082369854658027549}, + {0.0019593827209883237, -0.00082369854658027549}, + {-0.0019593827209883237, 0.00082369854658027549}, + {-0.0019593827209883237, -0.00082369854658027549} + } + },{ + "mbt_s_s", + "+proj=mbt_s +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {204831.24057099217, 121816.46669603503}, + {204831.24057099217, -121816.46669603503}, + {-204831.24057099217, 121816.46669603503}, + {-204831.24057099217, -121816.46669603503} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019526892859206603, 0.00082088471512331508}, + {0.0019526892859206603, -0.00082088471512331508}, + {-0.0019526892859206603, 0.00082088471512331508}, + {-0.0019526892859206603, -0.00082088471512331508} + } + },{ + "tcc", + "+proj=tcc +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223458.84419245756, 111769.14504058579}, + {223458.84419245756, -111769.14504058579}, + {-223458.84419245756, 111769.14504058579}, + {-223458.84419245756, -111769.14504058579} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "tcea", + "+proj=tcea +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223322.76057672748, 111769.14504058579}, + { 223322.76057672748, -111769.14504058579}, + {-223322.76057672748, 111769.14504058579}, + {-223322.76057672748, -111769.14504058579} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931102938101, 0.00089524655445477922}, + { 0.0017904931102938101, -0.00089524655445477922}, + {-0.0017904931102938101, 0.00089524655445477922}, + {-0.0017904931102938101, -0.00089524655445477922} + } + }, + // times projection not implemented + { + "tmerc_e", + "+proj=tmerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222650.79679577847, 110642.22941192707}, + { 222650.79679577847, -110642.22941192707}, + {-222650.79679577847, 110642.22941192707}, + {-222650.79679577847, -110642.22941192707} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305681649396, 0.00090436947663183841}, + { 0.0017966305681649396, -0.00090436947663183841}, + {-0.0017966305681649396, 0.00090436947663183841}, + {-0.0017966305681649396, -0.00090436947663183841} + } + },{ + "tmerc_s", + "+proj=tmerc +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223413.46640632232, 111769.14504059685}, + { 223413.46640632232, -111769.14504059685}, + {-223413.46640632208, 111769.14504059685}, + {-223413.46640632208, -111769.14504059685} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097048034, 0.00089524670602767842}, + { 0.0017904931097048034, -0.00089524670602767842}, + {-0.001790493109714345, 0.00089524670602767842}, + {-0.001790493109714345, -0.00089524670602767842} + } + },{ + "tpeqd_e", + "+proj=tpeqd +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-27750.758831679042, -222599.40369177726}, + {-250434.93702403645, -222655.93819326628}, + {-27750.758831679042, 222599.40369177726}, + {-250434.93702403645, 222655.93819326628} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-0.00089855554821257374, 1.2517966304145272}, + {0.0008985555481998515, 1.2517966304145272}, + {-0.00089855431859741167, 1.2482033692781642}, + {0.00089855431859741167, 1.2482033692781642} + } + },{ + "tpeqd_s", + "+proj=tpeqd +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-27845.882978485075, -223362.43069526015}, + {-251293.37876465076, -223419.15898590829}, + {-27845.882978485075, 223362.43069526015}, + {-251293.37876465076, 223419.15898590829} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-0.00089548606640108474, 1.2517904929571837}, + {0.0008954860663883625, 1.2517904929571837}, + {-0.000895484845182587, 1.248209506737604}, + {0.00089548484516986475, 1.248209506737604} + } + },{ + "urm5", + "+proj=urm5 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223393.6384339639, 111696.81878511712}, + { 223393.6384339639, -111696.81878511712}, + {-223393.6384339639, 111696.81878511712}, + {-223393.6384339639, -111696.81878511712} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "urmfps", + "+proj=urmfps +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 196001.70813419219, 127306.84332999329}, + { 196001.70813419219, -127306.84332999329}, + {-196001.70813419219, 127306.84332999329}, + {-196001.70813419219, -127306.84332999329} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002040720839642371, 0.00078547381740438178}, + { 0.002040720839642371, -0.00078547381740438178}, + {-0.002040720839642371, 0.00078547381740438178}, + {-0.002040720839642371, -0.00078547381740438178} + } + },{ + "wag1", + "+proj=wag1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 195986.78156115755, 127310.07506065986}, + { 195986.78156115755, -127310.07506065986}, + {-195986.78156115755, 127310.07506065986}, + {-195986.78156115755, -127310.07506065986} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002040720839738254, 0.00078547381739207999}, + { 0.002040720839738254, -0.00078547381739207999}, + {-0.002040720839738254, 0.00078547381739207999}, + {-0.002040720839738254, -0.00078547381739207999} + } + },{ + "vandg", + "+proj=vandg +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223395.24954340671, 111704.59663367498}, + { 223395.24954340671, -111704.59663367498}, + {-223395.24954340671, 111704.59663367498}, + {-223395.24954340671, -111704.59663367498} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493715929761, 0.00089524655486993867}, + { 0.001790493715929761, -0.00089524655486993867}, + {-0.001790493715929761, 0.00089524655486993867}, + {-0.001790493715929761, -0.00089524655486993867} + } + },{ + "vandg2", + "+proj=vandg2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223395.24785043663, 111718.49103722633}, + { 223395.24785043663, -111718.49103722633}, + {-223395.24785043663, 111718.49103722633}, + {-223395.24785043663, -111718.49103722633} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "vandg3", + "+proj=vandg3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223395.24955283134, 111704.51990442065}, + { 223395.24955283134, -111704.51990442065}, + {-223395.24955283134, 111704.51990442065}, + {-223395.24955283134, -111704.51990442065} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "vandg4", + "+proj=vandg4 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.57729435508, 111701.19548415358 }, + { 223374.57729435508, -111701.19548415358 }, + {-223374.57729435508, 111701.19548415358 }, + {-223374.57729435508, -111701.19548415358 } + }, + {},{{HUGE_VAL, HUGE_VAL}} + }, + // vgridshift projection is not implemented in Boost.Geometry + // and the Proj4 test is in a different format + { + "wag2", + "+proj=wag2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 206589.88809996162, 120778.04035754716}, + { 206589.88809996162, -120778.04035754716}, + {-206589.88809996162, 120778.04035754716}, + {-206589.88809996162, -120778.04035754716} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019360240367390709, 0.00082795765763814082}, + { 0.0019360240367390709, -0.00082795765763814082}, + {-0.0019360240367390709, 0.00082795765763814082}, + {-0.0019360240367390709, -0.00082795765763814082} + } + },{ + "wag3", + "+proj=wag3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223387.02171816575, 111701.07212763709}, + {223387.02171816575, -111701.07212763709}, + {-223387.02171816575, 111701.07212763709}, + {-223387.02171816575, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.001790493109880963, 0.00089524655489191132}, + {0.001790493109880963, -0.00089524655489191132}, + {-0.001790493109880963, 0.00089524655489191132}, + {-0.001790493109880963, -0.00089524655489191132} + } + },{ + "wag7", + "+proj=wag7 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 198601.87695731167, 125637.0457141714}, + { 198601.87695731167, -125637.0457141714}, + {-198601.87695731167, 125637.0457141714}, + {-198601.87695731167, -125637.0457141714} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "wink1", + "+proj=wink1 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.13164095284, 111701.07212763709}, + { 223385.13164095284, -111701.07212763709}, + {-223385.13164095284, 111701.07212763709}, + {-223385.13164095284, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931098931057, 0.00089524655489191132}, + { 0.0017904931098931057, -0.00089524655489191132}, + {-0.0017904931098931057, 0.00089524655489191132}, + {-0.0017904931098931057, -0.00089524655489191132} + } + },{ + "wink2", + "+proj=wink2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223387.39643378611, 124752.03279744535}, + { 223387.39643378611, -124752.03279744535}, + {-223387.39643378611, 124752.03279744535}, + {-223387.39643378611, -124752.03279744535} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "etmerc", + "+proj=etmerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5 +zone=30", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222650.79679758562, 110642.22941193319}, + {222650.79679758562, -110642.22941193319}, + {-222650.79679758562, 110642.22941193319}, + {-222650.79679758562, -110642.22941193319} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305681649398, 0.00090436947663183873}, + {0.0017966305681649398, -0.00090436947663183873}, + {-0.0017966305681649398, 0.00090436947663183873}, + {-0.0017966305681649398, -0.00090436947663183873} + } + },{ + "utm", + "+proj=utm +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5 +zone=30", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {1057002.4054912981, 110955.14117594929}, + {1057002.4054912981, -110955.14117594929}, + {611263.81227890507, 110547.10569680421}, + {611263.81227890507, -110547.10569680421} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-7.4869520833902357, 0.00090193980983462605}, + {-7.4869520833902357, -0.00090193980983462605}, + {-7.4905356820622613, 0.00090193535121489081}, + {-7.4905356820622613, -0.00090193535121489081} + } + } +}; + +#endif // BOOST_GEOMETRY_TEST_SRS_PROJECTION_SELFTEST_CASES_HPP diff --git a/src/boost/libs/geometry/test/srs/projections.cpp b/src/boost/libs/geometry/test/srs/projections.cpp new file mode 100644 index 00000000..c81daef9 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projections.cpp @@ -0,0 +1,370 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + // WARNING: this file takes several minutes to quarters to compile on GCC + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + + +#include <sstream> + +#include <geometry_test_common.hpp> + +#include <boost/geometry/geometries/point_xy.hpp> + +#include <boost/geometry/srs/projection.hpp> + +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/adapted/c_array.hpp> + +#include <test_common/test_point.hpp> + + +namespace srs = bg::srs; + +inline void check(double v, double ve, std::string const& name, std::string const& axis) +{ + //BOOST_CHECK_CLOSE(v, ve, 0.001); + + bool ok = ::boost::test_tools::check_is_close_t()(v, ve, ::boost::math::fpc::percent_tolerance(0.001)); + BOOST_CHECK_MESSAGE((ok), name << " " << axis << " -> " << v << " != " << ve); +} + +template <typename P> +void test_forward(std::string const& name, + double lon, double lat, + typename bg::coordinate_type<P>::type x, + typename bg::coordinate_type<P>::type y, + std::string const& parameters) +{ + typedef typename bg::coordinate_type<P>::type coord_type; + typedef bg::model::point<coord_type, 2, bg::cs::geographic<bg::degree> > lonlat_type; + + lonlat_type ll; + bg::set<0>(ll, lon); + bg::set<1>(ll, lat); + + srs::projection<> prj = srs::proj4(parameters); + + P xy; + prj.forward(ll, xy); + + //std::cout << std::setprecision(16) << bg::get<0>(xy) << " " << bg::get<1>(xy) << std::endl; + + check(bg::get<0>(xy), x, name, "x"); + check(bg::get<1>(xy), y, name, "y"); +} + +template <typename P> +void test_inverse(std::string const& name, + typename bg::coordinate_type<P>::type x, + typename bg::coordinate_type<P>::type y, + double lon, double lat, + std::string const& parameters) +{ + typedef typename bg::coordinate_type<P>::type coord_type; + typedef bg::model::point<coord_type, 2, bg::cs::geographic<bg::degree> > lonlat_type; + + P xy; + bg::set<0>(xy, x); + bg::set<1>(xy, y); + + srs::projection<> prj = srs::proj4(parameters); + + lonlat_type ll; + prj.inverse(xy, ll); + + //std::cout << std::setprecision(16) << bg::get<0>(ll) << " " << bg::get<1>(ll) << std::endl; + + check(bg::get<0>(ll), lon, name, "lon"); + check(bg::get<1>(ll), lat, name, "lat"); +} + + +template <typename P> +void test_all() +{ + test_forward<P>("aea", 4.897000, 52.371000, 334609.583974, 5218502.503686, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); + test_forward<P>("aeqd", 4.897000, 52.371000, 384537.462363, 5809944.807548, "+proj=aeqd +ellps=WGS84 +units=m"); + test_forward<P>("airy", 4.897000, 52.371000, 328249.003313, 4987937.101447, "+proj=airy +ellps=WGS84 +units=m"); + test_forward<P>("aitoff", 4.897000, 52.371000, 384096.182830, 5831239.274680, "+proj=aitoff +ellps=WGS84 +units=m"); + test_forward<P>("alsk", -84.390000, 33.755000, 7002185.416415, -3700467.546545, "+proj=alsk +ellps=WGS84 +units=m +lon_0=-150W"); + test_forward<P>("apian", 4.897000, 52.371000, -489503.746852, 5829913.052335, "+proj=apian +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward<P>("august", 4.897000, 52.371000, 472494.816642, 6557137.075680, "+proj=august +ellps=WGS84 +units=m"); + test_forward<P>("bacon", 4.897000, 52.371000, -276322.940590, 7934660.138798, "+proj=bacon +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward<P>("bipc", 4.897000, 52.371000, 3693973.674143, -8459972.647559, "+proj=bipc +ellps=WGS84 +units=m"); + test_forward<P>("boggs", 4.897000, 52.371000, -469734.523784, 5966441.169806, "+proj=boggs +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward<P>("bonne", 4.897000, 52.371000, 333291.091896, 274683.016972, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50"); + test_forward<P>("cass", 4.897000, 52.371000, 333274.431072, 5815921.803069, "+proj=cass +ellps=WGS84 +units=m"); + test_forward<P>("cc", 4.897000, 52.371000, 545131.546415, 8273513.720038, "+proj=cc +ellps=WGS84 +units=m"); + test_forward<P>("cea", 4.897000, 52.371000, -738753.247401, 5031644.669407, "+proj=cea +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward<P>("chamb", 4.897000, 52.371000, -3221300.532044, 872840.127676, "+proj=chamb +ellps=WGS84 +units=m +lat_1=52 +lon_1=5 +lat_2=30 +lon_2=80 +lat_3=20 +lon_3=-50"); + test_forward<P>("collg", 4.897000, 52.371000, 280548.640940, 6148862.475491, "+proj=collg +ellps=WGS84 +units=m"); + test_forward<P>("crast", 4.897000, 52.371000, 340944.220871, 5874029.522010, "+proj=crast +ellps=WGS84 +units=m"); + test_forward<P>("denoy", 4.897000, 52.371000, 382253.324398, 5829913.052335, "+proj=denoy +ellps=WGS84 +units=m"); + test_forward<P>("eck1", 4.897000, 52.371000, 356112.818167, 5371202.270688, "+proj=eck1 +ellps=WGS84 +units=m"); + test_forward<P>("eck2", 4.897000, 52.371000, 320023.223588, 6697754.654662, "+proj=eck2 +ellps=WGS84 +units=m"); + test_forward<P>("eck3", 4.897000, 52.371000, 417367.858470, 4923223.990430, "+proj=eck3 +ellps=WGS84 +units=m"); + test_forward<P>("eck4", 4.897000, 52.371000, 383678.300021, 6304427.033917, "+proj=eck4 +ellps=WGS84 +units=m"); + test_forward<P>("eck5", 4.897000, 52.371000, 387191.346304, 5142132.228246, "+proj=eck5 +ellps=WGS84 +units=m"); + test_forward<P>("eck6", 4.897000, 52.371000, 342737.885307, 6363364.830847, "+proj=eck6 +ellps=WGS84 +units=m"); + test_forward<P>("eqc", 4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=eqc +ellps=WGS84 +units=m"); + test_forward<P>("eqdc", 4.897000, 52.371000, 307874.536263, 5810915.646438, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_forward<P>("etmerc", 4.897000, 52.371000, 333425.492123, 5815921.814393, "+proj=etmerc +ellps=WGS84 +units=m"); + test_forward<P>("euler", 4.897000, 52.371000, 338753.024859, 5836825.984893, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_forward<P>("fahey", 4.897000, 52.371000, 388824.354103, 5705638.873094, "+proj=fahey +ellps=WGS84 +units=m"); + test_forward<P>("fouc", 4.897000, 52.371000, 268017.369817, 6272855.564674, "+proj=fouc +ellps=WGS84 +units=m"); + test_forward<P>("fouc_s", 4.897000, 52.371000, 545131.546415, 5051361.531375, "+proj=fouc_s +ellps=WGS84 +units=m"); + test_forward<P>("gall", 4.897000, 52.371000, 385466.213109, 5354217.135929, "+proj=gall +ellps=WGS84 +units=m"); + test_forward<P>("geocent", 4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=geocent +ellps=WGS84 +units=m"); + test_forward<P>("geos", 4.897000, 52.371000, 313594.638994, 4711397.361812, "+proj=geos +ellps=WGS84 +units=m +h=40000000"); + test_forward<P>("gins8", 4.897000, 52.371000, 409919.989781, 6235811.415629, "+proj=gins8 +ellps=WGS84 +units=m"); + test_forward<P>("gn_sinu", 4.897000, 52.371000, 326082.668183, 6264971.711917, "+proj=gn_sinu +ellps=WGS84 +units=m +m=0.5 +n=1.785"); + test_forward<P>("gnom", 4.897000, 52.371000, 546462.815658, 8303824.612633, "+proj=gnom +ellps=WGS84 +units=m"); + test_forward<P>("goode", 4.897000, 52.371000, 360567.451176, 5782693.787691, "+proj=goode +ellps=WGS84 +units=m"); + test_forward<P>("gs48", -84.390000, 33.755000, 4904886.323054, 12421187.782392, "+proj=gs48 +ellps=WGS84 +units=m +lon1=-48"); + test_forward<P>("gs50", -84.390000, 33.755000, 3190310.148850, -564230.076744, "+proj=gs50 +ellps=WGS84 +units=m +lon1=-50"); + test_forward<P>("gstmerc", 4.897000, 52.371000, 333173.875017, 5815062.181746, "+proj=gstmerc +ellps=WGS84 +units=m"); + test_forward<P>("hammer", 4.897000, 52.371000, 370843.923425, 5630047.232233, "+proj=hammer +ellps=WGS84 +units=m"); + test_forward<P>("hatano", 4.897000, 52.371000, 383644.128560, 6290117.704632, "+proj=hatano +ellps=WGS84 +units=m"); + test_forward<P>("healpix", 4.897000, 52.371000, 1469886.5704, 6042138.5098, "+proj=healpix +ellps=WGS84 +units=m"); + test_forward<P>("rhealpix", 4.897000, 52.371000, -11477441.24814, 13972970.8457, "+proj=rhealpix +ellps=WGS84 +units=m"); + test_forward<P>("imw_p", 4.897000, 52.371000, 318784.808056, 3594184.939568, "+proj=imw_p +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=5"); + test_forward<P>("isea", 4.897000, 52.371000, -413613.639976, 9218173.701546, "+proj=isea +ellps=WGS84 +units=m"); + test_forward<P>("kav5", 4.897000, 52.371000, 383646.088858, 5997047.888175, "+proj=kav5 +ellps=WGS84 +units=m"); + test_forward<P>("kav7", 4.897000, 52.371000, 407769.043907, 5829913.052335, "+proj=kav7 +ellps=WGS84 +units=m"); + test_forward<P>("krovak", 14.416667, 50.083333, -743286.779768, -1043498.912060, "+proj=krovak +ellps=WGS84 +units=m"); + test_forward<P>("laea", 4.897000, 52.371000, 371541.476735, 5608007.251007, "+proj=laea +ellps=WGS84 +units=m"); + test_forward<P>("lagrng", 4.897000, 52.371000, 413379.673720, 6281547.821085, "+proj=lagrng +ellps=WGS84 +units=m +W=1"); + test_forward<P>("larr", 4.897000, 52.371000, 485541.716273, 6497324.523196, "+proj=larr +ellps=WGS84 +units=m"); + test_forward<P>("lask", 4.897000, 52.371000, 456660.618715, 6141427.377857, "+proj=lask +ellps=WGS84 +units=m"); + test_forward<P>("latlon", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlon +ellps=WGS84 +units=m"); + test_forward<P>("latlong", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlong +ellps=WGS84 +units=m"); + test_forward<P>("lcc", 4.897000, 52.371000, 319700.820572, 5828852.504871, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward<P>("lcca", 4.897000, 52.371000, 363514.402883, 2555324.493896, "+proj=lcca +ellps=WGS84 +units=m +lat_0=30n +lat_1=55n +lat_2=60n"); + test_forward<P>("leac", 4.897000, 52.371000, 249343.870798, 6909632.226405, "+proj=leac +ellps=WGS84 +units=m"); + test_forward<P>("lee_os", -84.390000, 33.755000, 7657412.020774, 4716426.185485, "+proj=lee_os +ellps=WGS84 +units=m"); + test_forward<P>("longlat", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=longlat +ellps=WGS84 +units=m"); + test_forward<P>("lonlat", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=lonlat +ellps=WGS84 +units=m"); + test_forward<P>("loxim", 4.897000, 52.371000, 462770.371742, 5829913.052335, "+proj=loxim +ellps=WGS84 +units=m"); + test_forward<P>("lsat", -84.390000, 33.755000, 16342543.294793, -2092348.169198, "+proj=lsat +ellps=WGS84 +units=m +lsat=1 +path=1"); + test_forward<P>("mbt_fps", 4.897000, 52.371000, 392815.792409, 6007058.470101, "+proj=mbt_fps +ellps=WGS84 +units=m"); + test_forward<P>("mbt_s", 4.897000, 52.371000, 389224.301381, 5893467.204064, "+proj=mbt_s +ellps=WGS84 +units=m"); + test_forward<P>("mbtfpp", 4.897000, 52.371000, 345191.582111, 6098551.031494, "+proj=mbtfpp +ellps=WGS84 +units=m"); + test_forward<P>("mbtfpq", 4.897000, 52.371000, 371214.469979, 5901319.366034, "+proj=mbtfpq +ellps=WGS84 +units=m"); + test_forward<P>("mbtfps", 4.897000, 52.371000, 325952.066750, 6266156.827884, "+proj=mbtfps +ellps=WGS84 +units=m"); + test_forward<P>("merc", 4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=merc +ellps=WGS84 +units=m"); + test_forward<P>("mil_os", 4.897000, 52.371000, -1017212.552960, 3685935.358004, "+proj=mil_os +ellps=WGS84 +units=m"); + test_forward<P>("mill", 4.897000, 52.371000, 545131.546415, 6431916.372717, "+proj=mill +ellps=WGS84 +units=m"); + test_forward<P>("moll", 4.897000, 52.371000, 360567.451176, 6119459.421291, "+proj=moll +ellps=WGS84 +units=m"); + test_forward<P>("murd1", 4.897000, 52.371000, 333340.993642, 5839071.944597, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward<P>("murd2", 4.897000, 52.371000, 317758.821713, 6759296.097305, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward<P>("murd3", 4.897000, 52.371000, 331696.409000, 5839224.186916, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward<P>("natearth", 4.897000, 52.371000, 409886.629231, 5862282.218987, "+proj=natearth +ellps=WGS84 +units=m"); + test_forward<P>("nell", 4.897000, 52.371000, 454576.246081, 5355027.851999, "+proj=nell +ellps=WGS84 +units=m"); + test_forward<P>("nell_h", 4.897000, 52.371000, 438979.742911, 5386970.539995, "+proj=nell_h +ellps=WGS84 +units=m"); + test_forward<P>("nicol", 4.897000, 52.371000, 360493.071000, 5836451.532406, "+proj=nicol +ellps=WGS84 +units=m"); + test_forward<P>("nsper", 4.897000, 52.371000, 0.521191, 7.919806, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000"); + test_forward<P>("nzmg", 174.783333, -36.850000, 2669448.884228, 6482177.102194, "+proj=nzmg +ellps=WGS84 +units=m"); + test_forward<P>("ob_tran", 4.897000, 52.371000, 8688996.467740, -3348342.663884, "+proj=ob_tran +ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"); + test_forward<P>("ocea", 4.897000, 52.371000, 14168517.320298, -923135.204172, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_forward<P>("oea", 4.897000, 52.371000, 545723.850088, 5058869.127694, "+proj=oea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e +m=1 +n=1"); + test_forward<P>("omerc", 4.897000, 52.371000, 1009705.329154, 5829437.254923, "+proj=omerc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_forward<P>("ortel", 4.897000, 52.371000, 360906.947408, 5829913.052335, "+proj=ortel +ellps=WGS84 +units=m"); + test_forward<P>("ortho", 4.897000, 52.371000, 332422.874291, 5051361.531375, "+proj=ortho +ellps=WGS84 +units=m"); + test_forward<P>("pconic", -70.400000, -23.650000, -2240096.398139, -6940342.146955, "+proj=pconic +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_0=60W"); + test_forward<P>("qsc", 4.897000, 52.371000, 543871.545186, 7341888.620371, "+proj=qsc +ellps=WGS84 +units=m"); + test_forward<P>("poly", 4.897000, 52.371000, 333274.269648, 5815908.957562, "+proj=poly +ellps=WGS84 +units=m"); + test_forward<P>("putp1", 4.897000, 52.371000, 375730.931178, 5523551.121434, "+proj=putp1 +ellps=WGS84 +units=m"); + test_forward<P>("putp2", 4.897000, 52.371000, 351480.997939, 5942668.547355, "+proj=putp2 +ellps=WGS84 +units=m"); + test_forward<P>("putp3", 4.897000, 52.371000, 287673.972013, 4651597.610600, "+proj=putp3 +ellps=WGS84 +units=m"); + test_forward<P>("putp3p", 4.897000, 52.371000, 361313.008033, 4651597.610600, "+proj=putp3p +ellps=WGS84 +units=m"); + test_forward<P>("putp4p", 4.897000, 52.371000, 351947.465829, 6330828.716145, "+proj=putp4p +ellps=WGS84 +units=m"); + test_forward<P>("putp5", 4.897000, 52.371000, 320544.316171, 5908383.682019, "+proj=putp5 +ellps=WGS84 +units=m"); + test_forward<P>("putp5p", 4.897000, 52.371000, 436506.666600, 5908383.682019, "+proj=putp5p +ellps=WGS84 +units=m"); + test_forward<P>("putp6", 4.897000, 52.371000, 324931.055842, 5842588.644796, "+proj=putp6 +ellps=WGS84 +units=m"); + test_forward<P>("putp6p", 4.897000, 52.371000, 338623.512107, 6396742.919679, "+proj=putp6p +ellps=WGS84 +units=m"); + test_forward<P>("qua_aut", 4.897000, 52.371000, 370892.621714, 5629072.862494, "+proj=qua_aut +ellps=WGS84 +units=m"); + test_forward<P>("robin", 4.897000, 52.371000, 394576.507489, 5570940.631371, "+proj=robin +ellps=WGS84 +units=m"); + test_forward<P>("rouss", 4.897000, 52.371000, 412826.227669, 6248368.849775, "+proj=rouss +ellps=WGS84 +units=m"); + test_forward<P>("rpoly", 4.897000, 52.371000, 332447.130797, 5841164.662431, "+proj=rpoly +ellps=WGS84 +units=m"); + test_forward<P>("sinu", 4.897000, 52.371000, 333528.909809, 5804625.044313, "+proj=sinu +ellps=WGS84 +units=m"); + test_forward<P>("somerc", 4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=somerc +ellps=WGS84 +units=m"); + test_forward<P>("stere", 4.897000, 52.371000, 414459.621827, 6255826.749872, "+proj=stere +ellps=WGS84 +units=m +lat_ts=30n"); + test_forward<P>("sterea", 4.897000, 52.371000, 121590.388077, 487013.903377, "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m"); + test_forward<P>("tcc", 4.897000, 52.371000, 332875.293370, 5841186.022551, "+proj=tcc +ellps=WGS84 +units=m"); + test_forward<P>("tcea", 4.897000, 52.371000, 332422.874291, 5841186.022551, "+proj=tcea +ellps=WGS84 +units=m"); + test_forward<P>("tissot", 4.897000, 52.371000, 431443.972539, 3808494.480735, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward<P>("tmerc", 4.897000, 52.371000, 333425.492136, 5815921.814396, "+proj=tmerc +ellps=WGS84 +units=m"); + test_forward<P>("tpeqd", 4.897000, 52.371000, 998886.128891, 873800.468721, "+proj=tpeqd +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=0 +lon_2=30e"); + test_forward<P>("tpers", 4.897000, 52.371000, -1172311.936260, 6263306.090352, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000"); + test_forward<P>("ups", 4.897000, 52.371000, 2369508.503532, -2312783.579527, "+proj=ups +ellps=WGS84 +units=m"); + test_forward<P>("urm5", 4.897000, 52.371000, 522185.854469, 5201544.371625, "+proj=urm5 +ellps=WGS84 +units=m +n=.3 +q=.3 +alpha=10"); + test_forward<P>("urmfps", 4.897000, 52.371000, 439191.083465, 5919500.887257, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50"); + test_forward<P>("utm", 4.897000, 52.371000, 220721.998929, 5810228.672907, "+proj=utm +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward<P>("vandg", 4.897000, 52.371000, 489005.929978, 6431581.024949, "+proj=vandg +ellps=WGS84 +units=m"); + test_forward<P>("vandg2", 4.897000, 52.371000, 488953.592205, 6434578.861895, "+proj=vandg2 +ellps=WGS84 +units=m"); + test_forward<P>("vandg3", 4.897000, 52.371000, 489028.113123, 6430309.983824, "+proj=vandg3 +ellps=WGS84 +units=m"); + test_forward<P>("vandg4", 4.897000, 52.371000, 360804.549444, 5831531.435618, "+proj=vandg4 +ellps=WGS84 +units=m"); + test_forward<P>("vitk1", 4.897000, 52.371000, 338522.044182, 5839611.656064, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward<P>("wag1", 4.897000, 52.371000, 348059.961742, 6344311.295111, "+proj=wag1 +ellps=WGS84 +units=m"); + test_forward<P>("wag2", 4.897000, 52.371000, 388567.174132, 6112322.636203, "+proj=wag2 +ellps=WGS84 +units=m"); + test_forward<P>("wag3", 4.897000, 52.371000, 447014.436776, 5829913.052335, "+proj=wag3 +ellps=WGS84 +units=m"); + test_forward<P>("wag4", 4.897000, 52.371000, 365021.547713, 6300040.998324, "+proj=wag4 +ellps=WGS84 +units=m"); + test_forward<P>("wag5", 4.897000, 52.371000, 379647.914735, 6771982.379506, "+proj=wag5 +ellps=WGS84 +units=m"); + test_forward<P>("wag6", 4.897000, 52.371000, 446107.907415, 5523551.121434, "+proj=wag6 +ellps=WGS84 +units=m"); + test_forward<P>("wag7", 4.897000, 52.371000, 366407.198644, 6169832.906560, "+proj=wag7 +ellps=WGS84 +units=m"); + test_forward<P>("weren", 4.897000, 52.371000, 402668.037596, 7243190.025762, "+proj=weren +ellps=WGS84 +units=m"); + test_forward<P>("wink1", 4.897000, 52.371000, 438979.742911, 5829913.052335, "+proj=wink1 +ellps=WGS84 +units=m"); + test_forward<P>("wink2", 4.897000, 52.371000, 472810.645318, 6313461.757868, "+proj=wink2 +ellps=WGS84 +units=m"); + test_forward<P>("wintri", 4.897000, 52.371000, 365568.851909, 5830576.163507, "+proj=wintri +ellps=WGS84 +units=m"); + + test_inverse<P>("aea", 334609.583974, 5218502.503686, 4.897000, 52.371000, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); + test_inverse<P>("aeqd", 384537.462363, 5809944.807548, 4.897000, 52.371000, "+proj=aeqd +ellps=WGS84 +units=m"); // F/I: 883.080918 + test_inverse<P>("aitoff", 384096.182830, 5831239.274680, 4.897000, 52.371000, "+proj=aitoff +ellps=WGS84 +units=m"); + test_inverse<P>("alsk", 7002185.416415, -3700467.546545, -84.389819, 33.754911, "+proj=alsk +ellps=WGS84 +units=m +lon_0=-150W"); // F/I: 19.398478 + test_inverse<P>("bipc", 3693973.674143, -8459972.647559, 4.897000, 52.371000, "+proj=bipc +ellps=WGS84 +units=m"); + test_inverse<P>("bonne", 333291.091896, 274683.016972, 4.897000, 52.371000, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50"); + test_inverse<P>("cass", 333274.431072, 5815921.803069, 4.897007, 52.371001, "+proj=cass +ellps=WGS84 +units=m"); // F/I: 0.460628 + test_inverse<P>("cc", 545131.546415, 8273513.720038, 4.897000, 52.371000, "+proj=cc +ellps=WGS84 +units=m"); + test_inverse<P>("cea", -738753.247401, 5031644.669407, 4.897000, 52.371000, "+proj=cea +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_inverse<P>("collg", 280548.640940, 6148862.475491, 4.897000, 52.371000, "+proj=collg +ellps=WGS84 +units=m"); + test_inverse<P>("crast", 340944.220871, 5874029.522010, 4.897000, 52.371000, "+proj=crast +ellps=WGS84 +units=m"); + test_inverse<P>("eck1", 356112.818167, 5371202.270688, 4.897000, 52.371000, "+proj=eck1 +ellps=WGS84 +units=m"); + test_inverse<P>("eck2", 320023.223588, 6697754.654662, 4.897000, 52.371000, "+proj=eck2 +ellps=WGS84 +units=m"); + test_inverse<P>("eck3", 417367.858470, 4923223.990430, 4.897000, 52.371000, "+proj=eck3 +ellps=WGS84 +units=m"); + test_inverse<P>("eck4", 383678.300021, 6304427.033917, 4.897000, 52.371000, "+proj=eck4 +ellps=WGS84 +units=m"); + test_inverse<P>("eck5", 387191.346304, 5142132.228246, 4.897000, 52.371000, "+proj=eck5 +ellps=WGS84 +units=m"); + test_inverse<P>("eck6", 342737.885307, 6363364.830847, 4.897000, 52.371000, "+proj=eck6 +ellps=WGS84 +units=m"); + test_inverse<P>("eqc", 545131.546415, 5829913.052335, 4.897000, 52.371000, "+proj=eqc +ellps=WGS84 +units=m"); + test_inverse<P>("eqdc", 307874.536263, 5810915.646438, 4.897000, 52.371000, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_inverse<P>("etmerc", 333425.492123, 5815921.814393, 4.897000, 52.371000, "+proj=etmerc +ellps=WGS84 +units=m"); + test_inverse<P>("euler", 338753.024859, 5836825.984893, 4.897000, 52.371000, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_inverse<P>("fahey", 388824.354103, 5705638.873094, 4.897000, 52.371000, "+proj=fahey +ellps=WGS84 +units=m"); + test_inverse<P>("fouc", 268017.369817, 6272855.564674, 4.897000, 52.371000, "+proj=fouc +ellps=WGS84 +units=m"); + test_inverse<P>("fouc_s", 545131.546415, 5051361.531375, 4.897000, 52.371000, "+proj=fouc_s +ellps=WGS84 +units=m"); + test_inverse<P>("gall", 385466.213109, 5354217.135929, 4.897000, 52.371000, "+proj=gall +ellps=WGS84 +units=m"); + test_inverse<P>("geocent", 545131.546415, 5829913.052335, 4.897000, 52.371000, "+proj=geocent +ellps=WGS84 +units=m"); + test_inverse<P>("geos", 313594.638994, 4711397.361812, 4.897000, 52.371000, "+proj=geos +ellps=WGS84 +units=m +h=40000000"); + test_inverse<P>("gn_sinu", 326082.668183, 6264971.711917, 4.897000, 52.371000, "+proj=gn_sinu +ellps=WGS84 +units=m +m=0.5 +n=1.785"); + test_inverse<P>("gnom", 546462.815658, 8303824.612633, 4.897000, 52.371000, "+proj=gnom +ellps=WGS84 +units=m"); + test_inverse<P>("goode", 360567.451176, 5782693.787691, 4.897000, 52.371000, "+proj=goode +ellps=WGS84 +units=m"); + test_inverse<P>("gs48", 4904886.323054, 12421187.782392, -84.387019, 33.726470, "+proj=gs48 +ellps=WGS84 +units=m +lon1=-48"); // F/I: 3176.559347 + test_inverse<P>("gs50", 3190310.148850, -564230.076744, -84.389678, 33.754825, "+proj=gs50 +ellps=WGS84 +units=m +lon1=-50"); // F/I: 35.589174 + test_inverse<P>("gstmerc", 333173.875017, 5815062.181746, 4.897000, 52.371000, "+proj=gstmerc +ellps=WGS84 +units=m"); + test_inverse<P>("hatano", 383644.128560, 6290117.704632, 4.897000, 52.371000, "+proj=hatano +ellps=WGS84 +units=m"); + test_inverse<P>("healpix", 1469886.5704, 6042138.5098, 4.897000, 52.371000, "+proj=healpix +ellps=WGS84 +units=m"); + test_inverse<P>("rhealpix", -11477441.24814, 13972970.8457, 4.897000, 52.371000, "+proj=rhealpix +ellps=WGS84 +units=m"); + test_inverse<P>("imw_p", 318784.808056, 3594184.939568, 4.897000, 52.371000, "+proj=imw_p +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=5"); + test_inverse<P>("kav5", 383646.088858, 5997047.888175, 4.897000, 52.371000, "+proj=kav5 +ellps=WGS84 +units=m"); + test_inverse<P>("kav7", 407769.043907, 5829913.052335, 4.897000, 52.371000, "+proj=kav7 +ellps=WGS84 +units=m"); + test_inverse<P>("krovak", -743286.779768, -1043498.912060, 14.417630, 50.084517, "+proj=krovak +ellps=WGS84 +units=m"); // F/I: 148.642889 + test_inverse<P>("laea", 371541.476735, 5608007.251007, 4.897000, 52.371000, "+proj=laea +ellps=WGS84 +units=m"); + test_inverse<P>("latlon", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=latlon +ellps=WGS84 +units=m"); + test_inverse<P>("latlong", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=latlong +ellps=WGS84 +units=m"); + test_inverse<P>("lcc", 319700.820572, 5828852.504871, 4.897000, 52.371000, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse<P>("lcca", 363514.402883, 2555324.493896, 4.897000, 52.371000, "+proj=lcca +ellps=WGS84 +units=m +lat_0=30n +lat_1=55n +lat_2=60n"); + test_inverse<P>("leac", 249343.870798, 6909632.226405, 4.897000, 52.371000, "+proj=leac +ellps=WGS84 +units=m"); + test_inverse<P>("lee_os", 7657412.020774, 4716426.185485, -84.390000, 33.755000, "+proj=lee_os +ellps=WGS84 +units=m"); + test_inverse<P>("longlat", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=longlat +ellps=WGS84 +units=m"); + test_inverse<P>("lonlat", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=lonlat +ellps=WGS84 +units=m"); + test_inverse<P>("loxim", 462770.371742, 5829913.052335, 4.897000, 52.371000, "+proj=loxim +ellps=WGS84 +units=m"); + test_inverse<P>("lsat", 16342543.294793, -2092348.169198, -84.390000, 33.755000, "+proj=lsat +ellps=WGS84 +units=m +lsat=1 +path=1"); // F/I: 0.001160 + test_inverse<P>("mbt_fps", 392815.792409, 6007058.470101, 4.897000, 52.371000, "+proj=mbt_fps +ellps=WGS84 +units=m"); + test_inverse<P>("mbt_s", 389224.301381, 5893467.204064, 4.897000, 52.371000, "+proj=mbt_s +ellps=WGS84 +units=m"); + test_inverse<P>("mbtfpp", 345191.582111, 6098551.031494, 4.897000, 52.371000, "+proj=mbtfpp +ellps=WGS84 +units=m"); + test_inverse<P>("mbtfpq", 371214.469979, 5901319.366034, 4.897000, 52.371000, "+proj=mbtfpq +ellps=WGS84 +units=m"); + test_inverse<P>("mbtfps", 325952.066750, 6266156.827884, 4.897000, 52.371000, "+proj=mbtfps +ellps=WGS84 +units=m"); + test_inverse<P>("merc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=merc +ellps=WGS84 +units=m"); + test_inverse<P>("mil_os", -1017212.552960, 3685935.358004, 4.897000, 52.371000, "+proj=mil_os +ellps=WGS84 +units=m"); + test_inverse<P>("mill", 545131.546415, 6431916.372717, 4.897000, 52.371000, "+proj=mill +ellps=WGS84 +units=m"); + test_inverse<P>("moll", 360567.451176, 6119459.421291, 4.897000, 52.371000, "+proj=moll +ellps=WGS84 +units=m"); + test_inverse<P>("murd1", 333340.993642, 5839071.944597, 4.897000, 52.371000, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse<P>("murd2", 317758.821713, 6759296.097305, 4.897000, 52.371000, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse<P>("murd3", 331696.409000, 5839224.186916, 4.897000, 52.371000, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse<P>("natearth", 409886.629231, 5862282.218987, 4.897000, 52.371000, "+proj=natearth +ellps=WGS84 +units=m"); + test_inverse<P>("nell", 454576.246081, 5355027.851999, 4.897000, 52.371000, "+proj=nell +ellps=WGS84 +units=m"); + test_inverse<P>("nell_h", 438979.742911, 5386970.539995, 4.897000, 52.371000, "+proj=nell_h +ellps=WGS84 +units=m"); + test_inverse<P>("nsper", 0.521191, 7.919806, 4.897000, 52.371000, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000"); + test_inverse<P>("nzmg", 2669448.884228, 6482177.102194, 174.783333, -36.850000, "+proj=nzmg +ellps=WGS84 +units=m"); + test_inverse<P>("ob_tran", 8688996.467740, -3348342.663884, 4.897000, 52.371000, "+proj=ob_tran +ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"); + test_inverse<P>("ocea", 14168517.320298, -923135.204172, 4.897000, 52.371000, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_inverse<P>("oea", 545723.850088, 5058869.127694, 4.897000, 52.371000, "+proj=oea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e +m=1 +n=1"); + test_inverse<P>("omerc", 1009705.329154, 5829437.254923, 4.897000, 52.371000, "+proj=omerc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_inverse<P>("ortho", 332422.874291, 5051361.531375, 4.897000, 52.371000, "+proj=ortho +ellps=WGS84 +units=m"); + test_inverse<P>("pconic", -2240096.398139, -6940342.146955, -70.400000, -23.650000, "+proj=pconic +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_0=60W"); // F/I: 4424863.377843 + test_inverse<P>("qsc", 543871.545186, 7341888.620371, 4.897000, 52.371000, "+proj=qsc +ellps=WGS84 +units=m"); + test_inverse<P>("poly", 333274.269648, 5815908.957562, 4.897000, 52.371000, "+proj=poly +ellps=WGS84 +units=m"); + test_inverse<P>("putp1", 375730.931178, 5523551.121434, 4.897000, 52.371000, "+proj=putp1 +ellps=WGS84 +units=m"); + test_inverse<P>("putp2", 351480.997939, 5942668.547355, 4.897000, 52.371000, "+proj=putp2 +ellps=WGS84 +units=m"); + test_inverse<P>("putp3", 287673.972013, 4651597.610600, 4.897000, 52.371000, "+proj=putp3 +ellps=WGS84 +units=m"); + test_inverse<P>("putp3p", 361313.008033, 4651597.610600, 4.897000, 52.371000, "+proj=putp3p +ellps=WGS84 +units=m"); + test_inverse<P>("putp4p", 351947.465829, 6330828.716145, 4.897000, 52.371000, "+proj=putp4p +ellps=WGS84 +units=m"); // F/I: 0.003779 + test_inverse<P>("putp5", 320544.316171, 5908383.682019, 4.897000, 52.371000, "+proj=putp5 +ellps=WGS84 +units=m"); + test_inverse<P>("putp5p", 436506.666600, 5908383.682019, 4.897000, 52.371000, "+proj=putp5p +ellps=WGS84 +units=m"); + test_inverse<P>("putp6", 324931.055842, 5842588.644796, 4.897000, 52.371000, "+proj=putp6 +ellps=WGS84 +units=m"); + test_inverse<P>("putp6p", 338623.512107, 6396742.919679, 4.897000, 52.371000, "+proj=putp6p +ellps=WGS84 +units=m"); + test_inverse<P>("qua_aut", 370892.621714, 5629072.862494, 4.897000, 52.371000, "+proj=qua_aut +ellps=WGS84 +units=m"); + test_inverse<P>("robin", 394576.507489, 5570940.631371, 4.897000, 52.371000, "+proj=robin +ellps=WGS84 +units=m"); + test_inverse<P>("rouss", 412826.227669, 6248368.849775, 4.959853, 52.433747, "+proj=rouss +ellps=WGS84 +units=m"); // F/I: 8188.459174 + test_inverse<P>("sinu", 333528.909809, 5804625.044313, 4.897000, 52.371000, "+proj=sinu +ellps=WGS84 +units=m"); + test_inverse<P>("somerc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=somerc +ellps=WGS84 +units=m"); + test_inverse<P>("sterea", 121590.388077, 487013.903377, 4.897000, 52.371000, "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m"); + test_inverse<P>("tcea", 332422.874291, 5841186.022551, 4.897000, 52.371000, "+proj=tcea +ellps=WGS84 +units=m"); + test_inverse<P>("tissot", 431443.972539, 3808494.480735, 4.897000, 52.371000, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse<P>("tmerc", 333425.492136, 5815921.814396, 4.897000, 52.371000, "+proj=tmerc +ellps=WGS84 +units=m"); + test_inverse<P>("tpeqd", 998886.128891, 873800.468721, 4.897000, 52.371000, "+proj=tpeqd +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=0 +lon_2=30e"); + test_inverse<P>("tpers", -1172311.936260, 6263306.090352, 4.897000, 52.371000, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000"); + test_inverse<P>("ups", 2369508.503532, -2312783.579527, 4.897000, 52.371000, "+proj=ups +ellps=WGS84 +units=m"); + test_inverse<P>("urmfps", 439191.083465, 5919500.887257, 4.897000, 52.371000, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50"); + test_inverse<P>("utm", 220721.998929, 5810228.672907, 4.897000, 52.371000, "+proj=utm +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_inverse<P>("vandg", 489005.929978, 6431581.024949, 4.897000, 52.371000, "+proj=vandg +ellps=WGS84 +units=m"); + test_inverse<P>("vitk1", 338522.044182, 5839611.656064, 4.897000, 52.371000, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse<P>("wag1", 348059.961742, 6344311.295111, 4.897000, 52.371000, "+proj=wag1 +ellps=WGS84 +units=m"); + test_inverse<P>("wag2", 388567.174132, 6112322.636203, 4.897000, 52.371000, "+proj=wag2 +ellps=WGS84 +units=m"); + test_inverse<P>("wag3", 447014.436776, 5829913.052335, 4.897000, 52.371000, "+proj=wag3 +ellps=WGS84 +units=m"); + test_inverse<P>("wag4", 365021.547713, 6300040.998324, 4.897000, 52.371000, "+proj=wag4 +ellps=WGS84 +units=m"); + test_inverse<P>("wag5", 379647.914735, 6771982.379506, 4.897000, 52.371000, "+proj=wag5 +ellps=WGS84 +units=m"); + test_inverse<P>("wag6", 446107.907415, 5523551.121434, 4.897000, 52.371000, "+proj=wag6 +ellps=WGS84 +units=m"); + test_inverse<P>("weren", 402668.037596, 7243190.025762, 4.897000, 52.371000, "+proj=weren +ellps=WGS84 +units=m"); // F/I: 0.003779 + test_inverse<P>("wink1", 438979.742911, 5829913.052335, 4.897000, 52.371000, "+proj=wink1 +ellps=WGS84 +units=m"); + + + // Badly behaving inverse projections, to be reported to Gerald Evenden + // other (probably because it is in Southern Hemisphere and inverse turns up in Northern... + //test_inverse<P>("stere", 828919.243654, 12511653.499743, 2.183333, 41.383333, "+proj=stere +ellps=WGS84 +units=m +lat_ts=30n"); // F/I: 1238647.010132 // DIFFERENCE proj4/ggl: 4588423, (0.000000, 0.000000) +} + +int test_main(int, char* []) +{ + //test_all<int[2]>(); + //test_all<float[2]>(); + //test_all<double[2]>(); + //test_all<test::test_point>(); + //test_all<bg::model::d2::point_xy<int> >(); + //test_all<bg::model::d2::point_xy<float> >(); + //test_all<bg::model::d2::point_xy<double> >(); + + // Leave only one here, because this divides compilation time with 6 or 7 + test_all<bg::model::d2::point_xy<long double> >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projections_combined.cpp b/src/boost/libs/geometry/test/srs/projections_combined.cpp new file mode 100644 index 00000000..b4fd0958 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projections_combined.cpp @@ -0,0 +1,169 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2017, 2018. +// Modifications 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) + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + +#define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE + +#include <geometry_test_common.hpp> + +#include <boost/geometry/srs/projection.hpp> + +#include <boost/geometry/core/coordinate_type.hpp> +#include <boost/geometry/algorithms/make.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + +#include "proj4.hpp" + +namespace srs = bg::srs; + +template <typename P> +bool check_expected(P const& p1, P const& p2) +{ + return bg::math::abs(bg::get<0>(p1) - bg::get<0>(p2)) <= 1.0 + && bg::math::abs(bg::get<1>(p1) - bg::get<1>(p2)) <= 1.0; +} + +template <typename StaticParams, typename GeoPoint, typename CartPoint> +void test_forward(std::string const& id, GeoPoint const& geo_point, CartPoint const& cart_point, + StaticParams const& params, std::string const& proj4 = "") +{ + try + { + srs::projection<StaticParams> prj = params; + + CartPoint xy; + prj.forward(geo_point, xy); + + bool ok = check_expected(xy, cart_point); + + BOOST_CHECK_MESSAGE(ok, + " id: " << id + << " point: " << bg::wkt(xy) + << " different than expected: " << bg::wkt(cart_point)); + + if (! proj4.empty()) + { + srs::projection<> prj2 = srs::proj4(proj4); + + CartPoint xy2; + prj2.forward(geo_point, xy2); + + bool eq2 = bg::equals(xy, xy2); + + BOOST_CHECK_MESSAGE(eq2, + " id: " << id << " result of static: " + << bg::wkt(xy) << " different than dynamic: " << bg::wkt(xy2)); + +#ifdef TEST_WITH_PROJ4 + pj_projection prj3(proj4); + + CartPoint xy3; + prj3.forward(geo_point, xy3); + + bool eq3 = bg::equals(xy, xy3); + + BOOST_CHECK_MESSAGE(eq3, + " id: " << id << " result: " + << bg::wkt(xy) << " different than proj4: " << bg::wkt(xy3)); +#endif // TEST_WITH_PROJ4 + } + } + catch(bg::projection_exception const& e) + { + std::cout << "Exception in " << id << " : " << e.code() << std::endl; + } + catch(...) + { + std::cout << "Exception (unknown) in " << id << std::endl; + } +} + +template <typename StaticParams, typename GeoPoint, typename CartPoint> +void test_forward(std::string const& id, GeoPoint const& geo_point, CartPoint const& cart_point, + std::string const& proj4 = "") +{ + test_forward(id, geo_point, cart_point, StaticParams(), proj4); +} + +template <typename T> +void test_all() +{ + typedef bg::model::point<T, 2, bg::cs::geographic<bg::degree> > geo_point_type; + typedef bg::model::point<T, 2, bg::cs::cartesian> cart; + + geo_point_type amsterdam = bg::make<geo_point_type>(4.8925, 52.3731); + geo_point_type utrecht = bg::make<geo_point_type>(5.1213, 52.0907); + + geo_point_type anchorage = bg::make<geo_point_type>(-149.90, 61.22); + geo_point_type juneau = bg::make<geo_point_type>(-134.42, 58.30); + + geo_point_type auckland = bg::make<geo_point_type>(174.74, -36.84); + geo_point_type wellington = bg::make<geo_point_type>(177.78, -41.29); + + geo_point_type aspen = bg::make<geo_point_type>(-106.84, 39.19); + geo_point_type denver = bg::make<geo_point_type>(-104.88, 39.76); + + using namespace srs::spar; + + // IGH (internally using moll/sinu) + { + typedef parameters<proj_igh, ellps_sphere, units_m> params_t; + std::string sparams = "+proj=igh +ellps=sphere +units=m"; + test_forward<params_t>("igh-am", amsterdam, cart(1489299.1509520211, 5776413.4260336142), sparams); + test_forward<params_t>("igh-ut", utrecht, cart(1498750.6627020084, 5747394.3313896423), sparams); + test_forward<params_t>("igh-as", aspen, cart(-11708973.126426676, 4357727.1232166551), sparams); + test_forward<params_t>("igh-de", denver, cart(-11536624.264589204, 4421108.2015589233), sparams); + test_forward<params_t>("igh-au", auckland, cart(18658819.353676274, -4096419.1686476548), sparams); + test_forward<params_t>("igh-we", wellington, cart(18733710.557981707, -4591140.1631184481), sparams); + test_forward<params_t>("igh-an", anchorage, cart(-14275110.630537530, 6648284.9393376000), sparams); + test_forward<params_t>("igh-ju", juneau, cart(-13421076.123140398, 6368936.3597440729), sparams); + } + + // Using moll + { + typedef parameters<proj_ob_tran, ellps_wgs84, o_proj<proj_moll>, units_m, o_lat_p<>, o_lon_p<> > params_t; + params_t params = params_t(proj_ob_tran(), ellps_wgs84(), o_proj<proj_moll>(), units_m(), o_lat_p<>(10), o_lon_p<>(90)); + std::string sparams = "+proj=ob_tran +ellps=WGS84 +o_proj=moll +units=m +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"; + test_forward<params_t>("obt-m-am", amsterdam, cart(8688778.3518596273, -3348126.4518623645), params, sparams); + test_forward<params_t>("obt-m-ut", utrecht, cart(8693109.5205437448, -3379708.1134765535), params, sparams); + test_forward<params_t>("obt-m-as", aspen, cart(3691751.3259231807, 2371456.9674431868), params, sparams); + test_forward<params_t>("obt-m-de", denver, cart(3764685.2104777521, 2185616.0182080171), params, sparams); + } + + // Using sinu + { + // In Proj4 >= 5.0.0 ob_tran projection doesn't overwrite the ellipsoid's parameters to make sphere in underlying projection + // So in order to use spherical sinu projection WGS84-compatible sphere has to be set manually. + typedef parameters<proj_ob_tran, a<>, es<>, o_proj<proj_sinu>, units_m, o_lat_p<>, o_lon_p<> > params_t; + params_t params = params_t(proj_ob_tran(), a<>(6378137), es<>(0), o_proj<proj_sinu>(), units_m(), o_lat_p<>(10), o_lon_p<>(90)); + std::string sparams = "+proj=ob_tran +a=6378137 +es=0 +o_proj=sinu +units=m +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"; + test_forward<params_t>("obt-s-am", amsterdam, cart(9220221.4221933037, -3059652.3579233172), params, sparams); + test_forward<params_t>("obt-s-ut", utrecht, cart(9216281.0977674071, -3089427.4415689218), params, sparams); + test_forward<params_t>("obt-s-as", aspen, cart(4010672.3356677019, 2150730.9484995930), params, sparams); + test_forward<params_t>("obt-s-de", denver, cart(4103945.8062708224, 1979964.9315176210), params, sparams); + } +} + +int test_main(int, char* []) +{ + test_all<double>(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projections_static.cpp b/src/boost/libs/geometry/test/srs/projections_static.cpp new file mode 100644 index 00000000..86e24395 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projections_static.cpp @@ -0,0 +1,290 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2017, 2018. +// Modifications 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) + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + +#include <geometry_test_common.hpp> + +#include <boost/geometry/srs/projection.hpp> + +#include <boost/geometry/core/coordinate_type.hpp> +#include <boost/geometry/algorithms/make.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + + +template <template <typename, typename> class Projection, typename GeoPoint> +void test_forward(GeoPoint const& geo_point1, GeoPoint const& geo_point2, + std::string const& sparams, int deviation = 1) +{ + typedef typename bg::coordinate_type<GeoPoint>::type coordinate_type; + typedef bg::model::d2::point_xy<coordinate_type> cartesian_point_type; + typedef bg::projections::parameters<double> parameters_type; + typedef bg::projections::detail::static_wrapper_f + < + Projection<coordinate_type, parameters_type>, + parameters_type + > projection_type; + + try + { + bg::srs::detail::proj4_parameters params(sparams); + parameters_type par = bg::projections::detail::pj_init<double>(params); + + projection_type prj(params, par); + + cartesian_point_type xy1, xy2; + prj.forward(geo_point1, xy1); + prj.forward(geo_point2, xy2); + + // Calculate distances in KM + int const distance_expected = static_cast<int>(bg::distance(geo_point1, geo_point2) / 1000.0); + int const distance_found = static_cast<int>(bg::distance(xy1, xy2) / 1000.0); + + int const difference = std::abs(distance_expected - distance_found); + BOOST_CHECK_MESSAGE(difference <= 1 || difference == deviation, + " projection: " << projection_type::get_name() + << " distance found: " << distance_found + << " expected: " << distance_expected); + +// For debug: +// std::cout << projection_type::get_name() << " " << distance_expected +// << " " << distance_found +// << " " << (difference > 1 && difference != deviation ? " *** WRONG ***" : "") +// << " " << difference +// << std::endl; + } + catch(bg::projection_exception const& e) + { + std::cout << "Exception in " << projection_type::get_name() << " : " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Exception (unknown) in " << projection_type::get_name() << std::endl; + } +} + +template <typename T> +void test_all() +{ + typedef bg::model::point<T, 2, bg::cs::geographic<bg::degree> > geo_point_type; + + geo_point_type amsterdam = bg::make<geo_point_type>(4.8925, 52.3731); + geo_point_type utrecht = bg::make<geo_point_type>(5.1213, 52.0907); + + // IMPORTANT: Compatible model has to be passed in order to assure correct initialization + + test_forward<bg::projections::aea_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); + test_forward<bg::projections::aeqd_e>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + test_forward<bg::projections::aeqd_s>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + test_forward<bg::projections::airy_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 4); + test_forward<bg::projections::aitoff_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::apian_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lon_0=11d32'00E"); + test_forward<bg::projections::august_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 14); + + test_forward<bg::projections::bacon_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lon_0=11d32'00E", 5); + test_forward<bg::projections::bipc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 7); + test_forward<bg::projections::boggs_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lon_0=11d32'00E", 2); + + test_forward<bg::projections::bonne_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_1=50"); + test_forward<bg::projections::bonne_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=50", 33); + + test_forward<bg::projections::cass_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + test_forward<bg::projections::cass_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::cc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 52); + + test_forward<bg::projections::cea_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lon_0=11d32'00E", 4); + test_forward<bg::projections::cea_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lon_0=11d32'00E", 4); + + test_forward<bg::projections::chamb_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=52 +lon_1=5 +lat_2=30 +lon_2=80 +lat_3=20 +lon_3=-50", 2); + test_forward<bg::projections::collg_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 5); + test_forward<bg::projections::crast_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::denoy_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::eck1_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::eck2_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::eck3_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::eck4_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::eck5_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + + test_forward<bg::projections::eck6_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + test_forward<bg::projections::eqc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 5); + test_forward<bg::projections::eqdc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_forward<bg::projections::etmerc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + test_forward<bg::projections::euler_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=60 +lat_2=0"); + + test_forward<bg::projections::fahey_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 5); + test_forward<bg::projections::fouc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 6); + test_forward<bg::projections::fouc_s_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 4); + test_forward<bg::projections::gall_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::geocent_other>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 5); + test_forward<bg::projections::geos_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +h=40000000", 13); + test_forward<bg::projections::gins8_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 7); + + test_forward<bg::projections::gn_sinu_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +m=0.5 +n=1.785"); + + test_forward<bg::projections::gnom_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 50); + test_forward<bg::projections::goode_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::gstmerc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::hammer_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::hatano_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + + test_forward<bg::projections::healpix_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 6); + test_forward<bg::projections::healpix_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 6); + test_forward<bg::projections::rhealpix_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 6); + test_forward<bg::projections::rhealpix_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 6); + + test_forward<bg::projections::imw_p_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=5"); + test_forward<bg::projections::isea_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::kav5_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::kav7_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::krovak_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + test_forward<bg::projections::laea_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::lagrng_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +W=1", 8); + test_forward<bg::projections::larr_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 13); + test_forward<bg::projections::lask_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 5); + test_forward<bg::projections::lcc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_1=20n +lat_2=60n", 2); + test_forward<bg::projections::lcca_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_0=30n +lat_1=55n +lat_2=60n", 2); + test_forward<bg::projections::leac_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 8); + test_forward<bg::projections::loxim_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 3); + test_forward<bg::projections::lsat_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lsat=1 +path=1", 3); + test_forward<bg::projections::mbt_fps_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::mbt_s_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::mbtfpp_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::mbtfpq_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + + test_forward<bg::projections::mbtfps_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + test_forward<bg::projections::merc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 22); + test_forward<bg::projections::merc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 22); + + test_forward<bg::projections::mil_os_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + test_forward<bg::projections::mill_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 14); + test_forward<bg::projections::moll_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::murd1_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n"); + test_forward<bg::projections::murd2_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n"); + test_forward<bg::projections::murd3_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n"); + test_forward<bg::projections::natearth_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::nell_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 4); + test_forward<bg::projections::nell_h_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 3); + test_forward<bg::projections::nicol_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + test_forward<bg::projections::oea_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e +m=1 +n=1", 4); + test_forward<bg::projections::omerc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_forward<bg::projections::ortel_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::ortho_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 9); + test_forward<bg::projections::pconic_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n +lon_0=10E"); + test_forward<bg::projections::qsc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 10); + test_forward<bg::projections::poly_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::putp1_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::putp2_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::putp3_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 6); + test_forward<bg::projections::putp3p_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 5); + test_forward<bg::projections::putp4p_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::putp5_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::putp5p_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 3); + test_forward<bg::projections::putp6_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::putp6p_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::qua_aut_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::robin_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::rouss_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 8); + test_forward<bg::projections::rpoly_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + test_forward<bg::projections::sinu_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + test_forward<bg::projections::sinu_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + test_forward<bg::projections::somerc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 22); + test_forward<bg::projections::stere_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_ts=50n", 8); + test_forward<bg::projections::sterea_ellipsoid>(amsterdam, utrecht, "+lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m"); + test_forward<bg::projections::tcc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::tcea_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::tissot_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n", 2); + + test_forward<bg::projections::tmerc_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::tmerc_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); + + test_forward<bg::projections::tpeqd_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n +lon_1=0 +lon_2=30e"); + test_forward<bg::projections::tpers_spheroid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000", 14); + + // Elliptical usage required + // TODO: if spherical UPS is not supported then ups_spheroid should be removed + //test_forward<bg::projections::ups_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 3); + test_forward<bg::projections::ups_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m", 3); + + test_forward<bg::projections::urm5_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +n=.3 +q=.3 +alpha=10", 4); + test_forward<bg::projections::urmfps_spheroid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +n=0.50", 4); + + test_forward<bg::projections::utm_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +lon_0=11d32'00E"); + + test_forward<bg::projections::vandg_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 13); + test_forward<bg::projections::vandg2_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 13); + test_forward<bg::projections::vandg3_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 13); + test_forward<bg::projections::vandg4_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::vitk1_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m +lat_1=20n +lat_2=60n"); + test_forward<bg::projections::wag1_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::wag2_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::wag3_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 3); + test_forward<bg::projections::wag4_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::wag5_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::wag6_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + test_forward<bg::projections::wag7_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 2); + test_forward<bg::projections::weren_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 4); + test_forward<bg::projections::wink1_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 3); + test_forward<bg::projections::wink2_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m", 4); + test_forward<bg::projections::wintri_spheroid>(amsterdam, utrecht, "+ellps=sphere +units=m"); + + // We SKIP ob_tran because it internally requires the factory and is, in that sense, not a static test + // test_forward<bg::projections::ob_tran_oblique>(amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"); + // test_forward<bg::projections::ob_tran_transverse>(amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"); + + // TODO: wrong projections or parameters or input points +// test_forward<bg::projections::ocea_spheroid>(auckland, wellington, "+ellps=sphere +units=m +lat_1=20s +lat_2=60s +lon_1=165e +lon_2=175e"); => distance is very large +// test_forward<bg::projections::nsper_spheroid>(amsterdam, utrecht, "+ellps=WGS84 +units=m +a=10 +h=40000000"); => distance is 0 +// test_forward<bg::projections::lee_os_ellipsoid>(amsterdam, utrecht, "+ellps=WGS84 +units=m"); => distance is 407 + + + // Alaska + { + geo_point_type anchorage = bg::make<geo_point_type>(-149.90, 61.22); + geo_point_type juneau = bg::make<geo_point_type>(-134.42, 58.30); + test_forward<bg::projections::alsk_ellipsoid>(anchorage, juneau, "+ellps=WGS84 +units=m +lon_0=-150W", 1); + } + // New Zealand + { + geo_point_type auckland = bg::make<geo_point_type>(174.74, -36.84); + geo_point_type wellington = bg::make<geo_point_type>(177.78, -41.29); + test_forward<bg::projections::nzmg_ellipsoid>(auckland, wellington, "+ellps=WGS84 +units=m", 0); + } + + // US + { + geo_point_type aspen = bg::make<geo_point_type>(-106.84, 39.19); + geo_point_type denver = bg::make<geo_point_type>(-104.88, 39.76); + // TODO: test_forward<bg::projections::gs48_ellipsoid>(aspen, denver, "+ellps=WGS84 +units=m +lon1=-48");=> distance is > 1000 + test_forward<bg::projections::gs50_ellipsoid>(aspen, denver, "+ellps=WGS84 +units=m +lon1=-50", 2); + } + +} + +int test_main(int, char* []) +{ + test_all<double>(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/spar.cpp b/src/boost/libs/geometry/test/srs/spar.cpp new file mode 100644 index 00000000..c8650d8b --- /dev/null +++ b/src/boost/libs/geometry/test/srs/spar.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 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) + + +#include <geometry_test_common.hpp> + +#include <boost/core/ignore_unused.hpp> +#include <boost/geometry/srs/projection.hpp> + + +namespace srs = bg::srs; +namespace par = bg::srs::spar; + + +int test_main(int, char* []) +{ + typedef par::proj_aea proj; + typedef par::ellps_clrk80 ellps; + typedef par::datum_ire65 datum; + typedef par::o_proj<par::proj_tmerc> o_proj; + typedef par::guam guam; + + BOOST_MPL_ASSERT_MSG((par::detail::is_param_tr<par::detail::proj_traits>::pred<proj>::value), + PROJ, (proj)); + BOOST_MPL_ASSERT_MSG((!par::detail::is_param_tr<par::detail::proj_traits>::pred<int>::value), + NOT_PROJ, (int)); + + BOOST_MPL_ASSERT_MSG((par::detail::is_param_tr<par::detail::ellps_traits>::pred<ellps>::value), + ELLPS, (ellps)); + BOOST_MPL_ASSERT_MSG((!par::detail::is_param_tr<par::detail::ellps_traits>::pred<int>::value), + NOT_ELLPS, (int)); + + BOOST_MPL_ASSERT_MSG((par::detail::is_param_tr<par::detail::datum_traits>::pred<datum>::value), + DATUM, (datum)); + BOOST_MPL_ASSERT_MSG((!par::detail::is_param_tr<par::detail::datum_traits>::pred<int>::value), + NOT_DATUM, (int)); + + BOOST_MPL_ASSERT_MSG((par::detail::is_param_t<par::o_proj>::pred<o_proj>::value), + O_PROJ, (o_proj)); + BOOST_MPL_ASSERT_MSG((!par::detail::is_param_t<par::o_proj>::pred<int>::value), + NOT_O_PROJ, (int)); + + BOOST_MPL_ASSERT_MSG((par::detail::is_param<par::guam>::pred<guam>::value), + GUAM, (guam)); + BOOST_MPL_ASSERT_MSG((!par::detail::is_param<par::guam>::pred<int>::value), + NOT_GUAM, (int)); + + typedef par::parameters<proj, ellps, datum, o_proj, guam> params; + typedef par::parameters<proj, ellps> params_e; + typedef par::parameters<proj, datum> params_d; + typedef par::parameters<proj> params_0; + + boost::ignore_unused<params, params_e, params_d, params_0>(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/srs_transformer.cpp b/src/boost/libs/geometry/test/srs/srs_transformer.cpp new file mode 100644 index 00000000..a7eb50c4 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/srs_transformer.cpp @@ -0,0 +1,108 @@ +// Boost.Geometry +// Unit Test + +// 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) + + +#include <geometry_test_common.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/srs/epsg.hpp> +#include <boost/geometry/srs/projection.hpp> +#include <boost/geometry/srs/transformation.hpp> +#include <boost/geometry/strategies/transform/srs_transformer.hpp> + +#include <boost/geometry/io/wkt/read.hpp> + +#include "check_geometry.hpp" + + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + using namespace bg::strategy::transform; + + typedef point<double, 2, cs::geographic<degree> > point_ll; + typedef point<double, 2, cs::cartesian> point_xy; + //typedef polygon<point_ll> polygon_ll; + //typedef polygon<point_xy> polygon_xy; + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + point_xy pt_xy2(0, 0); + + srs_forward_transformer<projection<> > strategy_pf = proj4("+proj=tmerc +ellps=WGS84 +units=m"); + srs_inverse_transformer<projection<> > strategy_pi = proj4("+proj=tmerc +ellps=WGS84 +units=m"); + srs_forward_transformer<transformation<> > strategy_tf(proj4("+proj=tmerc +ellps=WGS84 +units=m"), + proj4("+proj=tmerc +ellps=clrk66 +units=m")); + srs_inverse_transformer<transformation<> > strategy_ti(proj4("+proj=tmerc +ellps=WGS84 +units=m"), + proj4("+proj=tmerc +ellps=clrk66 +units=m")); + + bg::transform(pt_ll, pt_xy, strategy_pf); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.0001); + + bg::transform(pt_xy, pt_ll2, strategy_pi); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.0001); + + bg::transform(pt_xy, pt_xy2, strategy_tf); + test::check_geometry(pt_xy2, "POINT(111309.54843459482 110584.27813586517)", 0.0001); + + bg::transform(pt_xy2, pt_xy, strategy_ti); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.0001); + } + + { + srs_forward_transformer<projection<> > strategy_pf = epsg(2000); + srs_inverse_transformer<projection<> > strategy_pi = epsg(2000); + srs_forward_transformer<transformation<> > strategy_tf(epsg(2000), epsg(2001)); + srs_inverse_transformer<transformation<> > strategy_ti(epsg(2000), epsg(2001)); + } + + { + using namespace bg::srs::spar; + + srs_forward_transformer + < + projection<parameters<proj_tmerc, ellps_wgs84> > + > strategy_pf; + srs_forward_transformer + < + projection<parameters<proj_tmerc, ellps_wgs84> > + > strategy_pi; + srs_forward_transformer + < + transformation + < + parameters<proj_tmerc, ellps_wgs84>, + parameters<proj_tmerc, ellps_clrk66> + > + > strategy_tf; + srs_forward_transformer + < + transformation + < + parameters<proj_tmerc, ellps_wgs84>, + parameters<proj_tmerc, ellps_clrk66> + > + > strategy_ti; + } + + { + srs_forward_transformer<projection<static_epsg<2000> > > strategy_pf; + srs_forward_transformer<projection<static_epsg<2000> > > strategy_pi; + srs_forward_transformer<transformation<static_epsg<2000>, static_epsg<2001> > > strategy_tf; + srs_forward_transformer<transformation<static_epsg<2000>, static_epsg<2001> > > strategy_ti; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/transformation_interface.cpp b/src/boost/libs/geometry/test/srs/transformation_interface.cpp new file mode 100644 index 00000000..46469a4c --- /dev/null +++ b/src/boost/libs/geometry/test/srs/transformation_interface.cpp @@ -0,0 +1,204 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017, 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) + + +#include <geometry_test_common.hpp> + +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/srs/transformation.hpp> + +#include "check_geometry.hpp" + +//#include <proj_api.h> + +template <typename T> +void test_geometries() +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef model::point<T, 2, cs::cartesian> point; + typedef model::segment<point> segment; + typedef model::linestring<point> linestring; + typedef model::ring<point> ring; + typedef model::polygon<point> polygon; + typedef model::multi_point<point> mpoint; + typedef model::multi_linestring<linestring> mlinestring; + typedef model::multi_polygon<polygon> mpolygon; + + std::cout << std::setprecision(12); + + double d2r = math::d2r<T>(); + //double r2d = math::r2d<T>(); + + std::string from = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"; + std::string to = "+proj=longlat +ellps=airy +datum=OSGB36 +no_defs"; + + { + point pt(18.5 * d2r, 54.2 * d2r); + point pt2(0, 0); + segment seg(pt, pt); + segment seg2; + linestring ls; ls.push_back(pt); + linestring ls2; + ring rg; rg.push_back(pt); + ring rg2; + polygon poly; poly.outer() = rg; + polygon poly2; + mpoint mpt; mpt.push_back(pt); + mpoint mpt2; + mlinestring mls; mls.push_back(ls); + mlinestring mls2; + mpolygon mpoly; mpoly.push_back(poly); + mpolygon mpoly2; + + transformation<> tr((proj4(from)), (proj4(to))); + //transformation<> tr((epsg(4326)), (epsg(25832))); + + tr.forward(pt, pt2); + tr.forward(seg, seg2); + tr.forward(ls, ls2); + tr.forward(rg, rg2); + tr.forward(poly, poly2); + tr.forward(mpt, mpt2); + tr.forward(mls, mls2); + tr.forward(mpoly, mpoly2); + + test::check_geometry(pt2, "POINT(0.322952937968 0.9459567165)", 0.001); + test::check_geometry(seg2, "LINESTRING(0.322952937968 0.9459567165,0.322952937968 0.9459567165)", 0.001); + test::check_geometry(ls2, "LINESTRING(0.322952937968 0.9459567165)", 0.001); + test::check_geometry(rg2, "POLYGON((0.322952937968 0.9459567165))", 0.001); + test::check_geometry(poly2, "POLYGON((0.322952937968 0.9459567165))", 0.001); + test::check_geometry(mpt2, "MULTIPOINT((0.322952937968 0.9459567165))", 0.001); + test::check_geometry(mls2, "MULTILINESTRING((0.322952937968 0.9459567165))", 0.001); + test::check_geometry(mpoly2, "MULTIPOLYGON(((0.322952937968 0.9459567165)))", 0.001); + + tr.inverse(pt2, pt); + tr.inverse(seg2, seg); + tr.inverse(ls2, ls); + tr.inverse(rg2, rg); + tr.inverse(poly2, poly); + tr.inverse(mpt2, mpt); + tr.inverse(mls2, mls); + tr.inverse(mpoly2, mpoly); + + test::check_geometry(pt, "POINT(0.322885911738 0.945968454552)", 0.001); + test::check_geometry(seg, "LINESTRING(0.322885911738 0.945968454552,0.322885911738 0.945968454552)", 0.001); + test::check_geometry(ls, "LINESTRING(0.322885911738 0.945968454552)", 0.001); + test::check_geometry(rg, "POLYGON((0.322885911738 0.945968454552))", 0.001); + test::check_geometry(poly, "POLYGON((0.322885911738 0.945968454552))", 0.001); + test::check_geometry(mpt, "MULTIPOINT((0.322885911738 0.945968454552))", 0.001); + test::check_geometry(mls, "MULTILINESTRING((0.322885911738 0.945968454552))", 0.001); + test::check_geometry(mpoly, "MULTIPOLYGON(((0.322885911738 0.945968454552)))", 0.001); + } + + /*{ + projPJ pj_from, pj_to; + + pj_from = pj_init_plus(from.c_str()); + pj_to = pj_init_plus(to.c_str()); + + double x = get<0>(pt_xy); + double y = get<1>(pt_xy); + pj_transform(pj_from, pj_to, 1, 0, &x, &y, NULL ); + + std::cout << x * r2d << " " << y * r2d << std::endl; + }*/ +} + +template <typename P1, typename P2, typename Tr> +inline void test_combination(Tr const& tr, P1 const& pt, + std::string const& expected_fwd, + P1 const& expected_inv) +{ + using namespace boost::geometry; + + P2 pt2; + + tr.forward(pt, pt2); + + test::check_geometry(pt2, expected_fwd, 0.001); + + P1 pt1; + + tr.inverse(pt2, pt1); + + test::check_geometry(pt1, expected_inv, 0.001); +} + +void test_combinations(std::string const& from, std::string const& to, + std::string const& in_deg, + std::string const& expected_deg, + std::string const& expected_rad, + std::string const& expected_inv_deg) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef model::point<double, 2, cs::cartesian> xy; + typedef model::point<double, 2, cs::geographic<degree> > ll_d; + typedef model::point<double, 2, cs::geographic<radian> > ll_r; + //typedef model::point<double, 3, cs::cartesian> xyz; + //typedef model::point<double, 3, cs::geographic<degree> > llz_d; + //typedef model::point<double, 3, cs::geographic<radian> > llz_r; + + transformation<> tr((proj4(from)), (proj4(to))); + + ll_d d; + bg::read_wkt(in_deg, d); + ll_r r(bg::get_as_radian<0>(d), bg::get_as_radian<1>(d)); + xy c(bg::get<0>(r), bg::get<1>(r)); + + ll_d inv_d; + bg::read_wkt(expected_inv_deg, inv_d); + ll_r inv_r(bg::get_as_radian<0>(inv_d), bg::get_as_radian<1>(inv_d)); + xy inv_c(bg::get<0>(inv_r), bg::get<1>(inv_r)); + + test_combination<xy, xy>(tr, c, expected_rad, inv_c); + test_combination<xy, ll_r>(tr, c, expected_rad, inv_c); + test_combination<xy, ll_d>(tr, c, expected_deg, inv_c); + test_combination<ll_r, xy>(tr, r, expected_rad, inv_r); + test_combination<ll_r, ll_r>(tr, r, expected_rad, inv_r); + test_combination<ll_r, ll_d>(tr, r, expected_deg, inv_r); + test_combination<ll_d, xy>(tr, d, expected_rad, inv_d); + test_combination<ll_d, ll_r>(tr, d, expected_rad, inv_d); + test_combination<ll_d, ll_d>(tr, d, expected_deg, inv_d); +} + +int test_main(int, char*[]) +{ + test_geometries<double>(); + test_geometries<float>(); + + test_combinations("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs", + "+proj=longlat +ellps=airy +datum=OSGB36 +no_defs", + "POINT(18.5 54.2)", + "POINT(18.5038403269 54.1993274575)", + "POINT(0.322952937968 0.9459567165)", + "POINT(18.5 54.2)"); + test_combinations("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs", + "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +no_defs", + "POINT(18.5 54.2)", + "POINT(2059410.57968 7208125.2609)", + "POINT(2059410.57968 7208125.2609)", + "POINT(18.5 54.2)"); + test_combinations("+proj=longlat +ellps=clrk80 +units=m +no_defs", + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs", + "POINT(1 1)", + "POINT(9413505.3284665551 237337.74515944949)", + "POINT(9413505.3284665551 237337.74515944949)", + // this result seems to be wrong, it's the same with projection + "POINT(-2.4463131191981073 1.5066638962045082)"); + + return 0; +} |