diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-01-16 17:17:54 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-01-16 17:18:30 +0100 |
| commit | 6d2af0904652baba69ec81261c914e9b68221dac (patch) | |
| tree | 289e2af7e0cb472d633e2357804e696714d1557b /test/unit | |
| parent | 15bbaa50ae6e5779462bb921a5f50126a2f2f252 (diff) | |
| download | PROJ-6d2af0904652baba69ec81261c914e9b68221dac.tar.gz PROJ-6d2af0904652baba69ec81261c914e9b68221dac.zip | |
PROJBasedOperation: write it as a conformant CONVERSION WKT, and make it parsed appropriately on the reading side
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_io.cpp | 14 | ||||
| -rw-r--r-- | test/unit/test_operation.cpp | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 2b5eeffc..43b74fd8 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -2280,6 +2280,20 @@ TEST(wkt_parse, COORDINATEOPERATION) { // --------------------------------------------------------------------------- +TEST(wkt_parse, conversion_proj_based) { + + auto wkt = "CONVERSION[\"PROJ-based coordinate operation\",\n" + " METHOD[\"PROJ-based operation method: +proj=merc\"]]"; + + auto obj = WKTParser().createFromWKT(wkt); + auto transf = nn_dynamic_pointer_cast<SingleOperation>(obj); + ASSERT_TRUE(transf != nullptr); + EXPECT_EQ(transf->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=merc"); +} + +// --------------------------------------------------------------------------- + TEST(wkt_parse, CONCATENATEDOPERATION) { auto transf_1 = Transformation::create( diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index d3f05548..bdadd830 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -4099,8 +4099,7 @@ TEST(operation, PROJ_based) { EXPECT_EQ(conv->exportToWKT(WKTFormatter::create().get()), "CONVERSION[\"PROJ-based coordinate operation\",\n" - " METHOD[\"PROJ-based operation method\"],\n" - " PARAMETER[\"PROJ string\",\"+proj=merc\"]]"); + " METHOD[\"PROJ-based operation method: +proj=merc\"]]"); EXPECT_EQ(conv->inverse()->exportToPROJString( PROJStringFormatter::create().get()), @@ -4135,8 +4134,7 @@ TEST(operation, PROJ_based_empty) { EXPECT_EQ(conv->exportToWKT(WKTFormatter::create().get()), "CONVERSION[\"PROJ-based coordinate operation\",\n" - " METHOD[\"PROJ-based operation method\"],\n" - " PARAMETER[\"PROJ string\",\"\"]]"); + " METHOD[\"PROJ-based operation method: \"]]"); EXPECT_THROW( conv->exportToWKT( |
