diff --git a/test/srs/projection.cpp b/test/srs/projection.cpp index 4e2db0e29..d2cb907be 100644 --- a/test/srs/projection.cpp +++ b/test/srs/projection.cpp @@ -38,6 +38,7 @@ namespace srs = bg::srs; +namespace par = bg::srs::par4; template void test_one(double lon, double lat, @@ -45,7 +46,8 @@ void test_one(double lon, double lat, typename bg::coordinate_type::type y, std::string const& parameters) { - srs::projection > prj = srs::static_proj4(parameters); + srs::projection, par::ellps > > + prj = srs::static_proj4, par::ellps >(parameters); P1 ll; bg::set<0>(ll, lon); @@ -65,7 +67,7 @@ void test_all() typedef bg::model::point > point_type; // aea - test_one + test_one (4.897000, 52.371000, 334609.583974, 5218502.503686, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); } diff --git a/test/srs/projection_interface.cpp b/test/srs/projection_interface.cpp index ec41bdddf..54896251f 100644 --- a/test/srs/projection_interface.cpp +++ b/test/srs/projection_interface.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "check_geometry.hpp" @@ -23,6 +24,7 @@ int test_main(int, char*[]) using namespace boost::geometry; using namespace boost::geometry::model; using namespace boost::geometry::srs; + using namespace boost::geometry::srs::par4; typedef point > point_ll; typedef point point_xy; @@ -61,8 +63,9 @@ int test_main(int, char*[]) point_ll pt_ll2(0, 0); point_xy pt_xy(0, 0); - // default WGS84 spheroid and additional parameters - projection > prj; + // default WGS84 spheroid + projection > > prj; + //projection, ellps > > prj; prj.forward(pt_ll, pt_xy); test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); @@ -87,25 +90,28 @@ int test_main(int, char*[]) } { - // default spheroid and additional parameters - projection > + // static_proj4 constructors + projection, ellps > > prj2; + projection, ellps > > + prj3 = static_proj4, ellps >(); + projection, ellps > > + prj4 = static_proj4, ellps >(""); - // default spheroid and additional parameters - projection > - prj3 = static_proj4(); + projection, datum > > + prj5; + projection, ellps, datum > > + prj6; + } - // passed spheroid and default additional parameters - projection > - prj4 = static_proj4(ellps::WGS84()); - - // default spheroid and passed additional parameters - projection > - prj5 = static_proj4(""); - - // passed spheroid and additional parameters - projection > - prj6 = static_proj4(ellps::WGS84(), ""); + { + typedef spheroid sph; + typedef ellps ell; + typedef proj prj; + projection > + prj1 = static_proj4(ell(sph(1000, 999))); + projection > + prj2 = static_proj4(ell(sph(1000, 999)), ""); } // compile-time errors @@ -116,7 +122,8 @@ int test_main(int, char*[]) //projection > prj1; //projection prj2; - projection > prj3; + projection > > prj3; + //projection, ellps > > prj3; //prj3.inverse(pt_xy, pt_ll); } diff --git a/test/srs/projections_combined.cpp b/test/srs/projections_combined.cpp index 1c1aeb0b1..0bbce41e3 100644 --- a/test/srs/projections_combined.cpp +++ b/test/srs/projections_combined.cpp @@ -30,6 +30,7 @@ namespace srs = bg::srs; +namespace par = bg::srs::par4; template void test_forward(std::string const& id, GeoPoint const& geo_point1, GeoPoint const& geo_point2, @@ -37,11 +38,12 @@ void test_forward(std::string const& id, GeoPoint const& geo_point1, GeoPoint co { typedef typename bg::coordinate_type::type coordinate_type; typedef bg::model::d2::point_xy cartesian_point_type; - typedef srs::projection > projection_type; + typedef srs::static_proj4, par::ellps > static_proj4; + typedef srs::projection projection_type; try { - projection_type prj = srs::static_proj4(parameters); + projection_type prj = static_proj4(parameters); cartesian_point_type xy1, xy2; prj.forward(geo_point1, xy1); @@ -92,26 +94,26 @@ void test_all() geo_point_type denver = bg::make(-104.88, 39.76); // IGH (internally using moll/sinu) - test_forward("igh-au", amsterdam, utrecht, "+ellps=sphere +units=m", 5); - test_forward("igh-ad", aspen, denver, "+ellps=sphere +units=m", 3); - test_forward("igh-aw", auckland, wellington, "+ellps=sphere +units=m", 152); - test_forward("igh-aj", anchorage, juneau, "+ellps=sphere +units=m", 28); + test_forward("igh-au", amsterdam, utrecht, "+ellps=sphere +units=m", 5); + test_forward("igh-ad", aspen, denver, "+ellps=sphere +units=m", 3); + test_forward("igh-aw", auckland, wellington, "+ellps=sphere +units=m", 152); + test_forward("igh-aj", anchorage, juneau, "+ellps=sphere +units=m", 28); // Using moll - //test_forward("obto-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 4); - //test_forward("obtt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 5); - test_forward("obt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 4); - //test_forward("obto-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 19); - //test_forward("obtt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 19); - test_forward("obt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 19); + //test_forward("obto-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 4); + //test_forward("obtt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 5); + test_forward("obt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 4); + //test_forward("obto-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 19); + //test_forward("obtt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 19); + test_forward("obt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 19); // Using sinu - //test_forward("obto-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 5); - //test_forward("obtt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 4); - test_forward("obt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 5); - //test_forward("obto-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 14); - //test_forward("obtt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 6); - test_forward("obt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 14); + //test_forward("obto-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 5); + //test_forward("obtt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 4); + test_forward("obt-au", amsterdam, utrecht, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 5); + //test_forward("obto-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 14); + //test_forward("obtt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 6); + test_forward("obt-ad", aspen, denver, "+ellps=WGS84 +units=m +o_proj=sinu +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50", 14); } diff --git a/test/srs/srs_transformer.cpp b/test/srs/srs_transformer.cpp index 8e4254671..41cf5f9c9 100644 --- a/test/srs/srs_transformer.cpp +++ b/test/srs/srs_transformer.cpp @@ -27,6 +27,7 @@ int test_main(int, char*[]) using namespace boost::geometry; using namespace boost::geometry::model; using namespace boost::geometry::srs; + using namespace boost::geometry::srs::par4; using namespace bg::strategy::transform; typedef point > point_ll; @@ -70,26 +71,26 @@ int test_main(int, char*[]) { srs_forward_transformer < - projection > + projection, ellps > > > strategy_pf; srs_forward_transformer < - projection > + projection, ellps > > > strategy_pi; srs_forward_transformer < transformation < - static_proj4, - static_proj4 + static_proj4, ellps >, + static_proj4, ellps > > > strategy_tf; srs_forward_transformer < transformation < - static_proj4, - static_proj4 + static_proj4, ellps >, + static_proj4, ellps > > > strategy_ti; }