diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-08-26 20:04:25 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-08-26 20:04:25 +0200 |
| commit | ae70b26b9cbae85a38d5b26533ba06da0ea13940 (patch) | |
| tree | 15798bd63b7a9ab3e0067ce3130ceea7535c62b4 /test | |
| parent | 78302efb70eb4b49610cda6a60bf9ce39b82264f (diff) | |
| download | PROJ-ae70b26b9cbae85a38d5b26533ba06da0ea13940.tar.gz PROJ-ae70b26b9cbae85a38d5b26533ba06da0ea13940.zip | |
createOperations(): follow-up of previous commit for +datum=NAD83 case
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/test_operation.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index f95f94bd..89edfca4 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -7090,6 +7090,54 @@ TEST( // --------------------------------------------------------------------------- +TEST(operation, + createOperation_fallback_to_proj4_strings_proj_NAD83_to_projliteral) { + auto objSrc = PROJStringParser().createFromPROJString( + "+proj=utm +zone=11 +datum=NAD83 +type=crs"); + auto src = nn_dynamic_pointer_cast<CRS>(objSrc); + ASSERT_TRUE(src != nullptr); + + auto objDst = PROJStringParser().createFromPROJString( + "+proj=longlat +datum=WGS84 +over +type=crs"); + auto dst = nn_dynamic_pointer_cast<CRS>(objDst); + ASSERT_TRUE(dst != nullptr); + + auto op = CoordinateOperationFactory::create()->createOperation( + NN_CHECK_ASSERT(src), NN_CHECK_ASSERT(dst)); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +inv +proj=utm +zone=11 +ellps=GRS80 " + "+step +proj=longlat +datum=WGS84 +over " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg"); +} + +// --------------------------------------------------------------------------- + +TEST(operation, + createOperation_fallback_to_proj4_strings_geog_NAD83_to_projliteral) { + auto objSrc = PROJStringParser().createFromPROJString( + "+proj=longlat +datum=NAD83 +type=crs"); + auto src = nn_dynamic_pointer_cast<CRS>(objSrc); + ASSERT_TRUE(src != nullptr); + + auto objDst = PROJStringParser().createFromPROJString( + "+proj=longlat +datum=WGS84 +over +type=crs"); + auto dst = nn_dynamic_pointer_cast<CRS>(objDst); + ASSERT_TRUE(dst != nullptr); + + auto op = CoordinateOperationFactory::create()->createOperation( + NN_CHECK_ASSERT(src), NN_CHECK_ASSERT(dst)); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +proj=longlat +datum=WGS84 +over " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg"); +} + +// --------------------------------------------------------------------------- + TEST( operation, createOperation_fallback_to_proj4_strings_regular_with_nadgrids_to_projliteral) { |
