From 925ae56c40b0cfa7d861f55e4332cb5603168a2c Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sat, 11 Apr 2020 12:13:46 +0200 Subject: Add proj_degree_input() and proj_degree_output() Equivalent to proj_angular_input() and proj_angular_output() but checking for degree units instead. proj_create_crs_to_crs() rarely, if ever, returns pipelines that has radians as input or output so using proj_angular_*() is not a useful check for io units of pipelines. These two new functions should make life a bit easier for users that generally store there angular coordinates in radians. Closes #2027 --- test/unit/proj_angular_io_test.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/unit/proj_angular_io_test.cpp') diff --git a/test/unit/proj_angular_io_test.cpp b/test/unit/proj_angular_io_test.cpp index dbf09986..30eae298 100644 --- a/test/unit/proj_angular_io_test.cpp +++ b/test/unit/proj_angular_io_test.cpp @@ -98,4 +98,23 @@ TEST(AngularUnits, Pipelines3) { proj_context_destroy(ctx); } +TEST(AngularUnits, Degrees) { + auto ctx = proj_context_create(); + auto P = proj_create( + ctx, + "+proj=pipeline " + "+step +inv +proj=utm +zone=32 +ellps=GRS80 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + ); + + EXPECT_FALSE(proj_degree_input(P, PJ_FWD)); + EXPECT_TRUE(proj_degree_input(P, PJ_INV)); + EXPECT_TRUE(proj_degree_output(P, PJ_FWD)); + EXPECT_FALSE(proj_degree_output(P, PJ_INV)); + + proj_destroy(P); + proj_context_destroy(ctx); + +} + } // namespace -- cgit v1.2.3