[test][projections] Use hybrid static projection interface if needed.

This commit is contained in:
Adam Wulkiewicz 2017-10-30 20:10:13 +01:00
parent e450c3b692
commit 923606e8aa
3 changed files with 20 additions and 13 deletions

View File

@ -22,7 +22,7 @@
#endif // defined(_MSC_VER)
#define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE
#include <geometry_test_common.hpp>
@ -46,8 +46,10 @@ void test_one(double lon, double lat,
typename bg::coordinate_type<P2>::type y,
std::string const& parameters)
{
// hybrid interface disabled by default
// static_proj4 default ctor, dynamic parameters passed
srs::projection<srs::static_proj4<par::proj<Prj>, par::ellps<Model> > >
prj = srs::static_proj4<par::proj<Prj>, par::ellps<Model> >(parameters);
prj = srs::proj4(parameters);
P1 ll;
bg::set<0>(ll, lon);

View File

@ -9,6 +9,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE
#include <geometry_test_common.hpp>
#include <boost/geometry.hpp>
@ -99,16 +101,13 @@ int test_main(int, char*[])
{
// static_proj4 constructors
projection<static_proj4<proj<tmerc>, ellps<WGS84> > >
prj2;
projection<static_proj4<proj<tmerc>, ellps<WGS84> > >
prj3 = static_proj4<proj<tmerc>, ellps<WGS84> >();
projection<static_proj4<proj<tmerc>, ellps<WGS84> > >
prj4 = static_proj4<proj<tmerc>, ellps<WGS84> >("");
projection<static_proj4<proj<tmerc>, datum<WGS84> > >
prj5;
prj1;
projection<static_proj4<proj<tmerc>, ellps<WGS84>, datum<WGS84> > >
prj6;
prj2;
#ifdef BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE
projection<static_proj4<proj<tmerc>, ellps<WGS84>, datum<WGS84> > >
prj3 = proj4("");
#endif
}
{
@ -117,8 +116,10 @@ int test_main(int, char*[])
typedef proj<tmerc> prj;
projection<static_proj4<ell, prj> >
prj1 = static_proj4<ell, prj>(ell(sph(1000, 999)));
#ifdef BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE
projection<static_proj4<ell, prj> >
prj2 = static_proj4<ell, prj>(ell(sph(1000, 999)), "");
prj2(static_proj4<ell, prj>(ell(sph(1000, 999))), proj4(""));
#endif
}
// compile-time errors

View File

@ -16,6 +16,8 @@
#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>
@ -42,7 +44,9 @@ void test_forward(std::string const& id, GeoPoint const& geo_point1, GeoPoint co
try
{
projection_type prj = StaticProj(parameters);
// hybrid interface disabled by default
// static_proj4 default ctor, dynamic parameters passed
projection_type prj = srs::proj4(parameters);
cartesian_point_type xy1, xy2;
prj.forward(geo_point1, xy1);