diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-09-08 14:34:50 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-09-08 17:05:45 +0200 |
| commit | 078952e7f078e029d66ab6ca1ed594dfecadd1fc (patch) | |
| tree | fe4d22d37c1ba5343a5f5b17382ba6a8a1cb154e /test/unit | |
| parent | bc568fcc99257731a939d93cd0caa4725e6803e4 (diff) | |
| download | PROJ-078952e7f078e029d66ab6ca1ed594dfecadd1fc.tar.gz PROJ-078952e7f078e029d66ab6ca1ed594dfecadd1fc.zip | |
createOperations(): use an explicit conversion operation for geodetic <--> geocentric latitude
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_operationfactory.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp index ec7d8700..b50542c6 100644 --- a/test/unit/test_operationfactory.cpp +++ b/test/unit/test_operationfactory.cpp @@ -6873,6 +6873,29 @@ TEST(operation, createOperation_geographic_to_spherical_ocentric) { // --------------------------------------------------------------------------- +TEST(operation, createOperation_spherical_ocentric_to_geocentric) { + auto objSrc = PROJStringParser().createFromPROJString( + "+proj=longlat +geoc +datum=WGS84 +type=crs"); + auto src = nn_dynamic_pointer_cast<GeodeticCRS>(objSrc); + ASSERT_TRUE(src != nullptr); + + auto objDest = PROJStringParser().createFromPROJString( + "+proj=geocent +datum=WGS84 +type=crs"); + auto dest = nn_dynamic_pointer_cast<GeodeticCRS>(objDest); + ASSERT_TRUE(dest != nullptr); + + auto op = CoordinateOperationFactory::create()->createOperation( + NN_CHECK_ASSERT(src), NN_CHECK_ASSERT(dest)); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +inv +proj=geoc +ellps=WGS84 " + "+step +proj=cart +ellps=WGS84"); +} + +// --------------------------------------------------------------------------- + TEST(operation, createOperation_bound_of_spherical_ocentric_to_same_type) { auto objSrc = PROJStringParser().createFromPROJString( "+proj=longlat +geoc +ellps=GRS80 +towgs84=1,2,3 +type=crs"); |
