From b7e7a3bd4a85ce07cc9dee457f3c44be43950084 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 11 Sep 2019 13:55:17 +0000 Subject: Ingestion of +proj=somerc +type=crs: avoid adding twice alpha, gamma, lon_0 (related to #1597) --- test/unit/test_io.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/unit/test_io.cpp') diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 7930ff53..46318ffb 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -7800,6 +7800,10 @@ TEST(io, projparse_somerc) { EXPECT_TRUE(wkt.find("\"Northing at projection centre\",5") != std::string::npos) << wkt; + + auto wkt1 = crs->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()); + EXPECT_TRUE(wkt1.find("EXTENSION") == std::string::npos) << wkt1; } // --------------------------------------------------------------------------- -- cgit v1.2.3 From 9e5807499c5a37d31f983cd58eb21c918daf1fef Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 11 Sep 2019 14:22:32 +0000 Subject: createFromPROJString(): ignore +no_defs when instanciating a '+init=epsg:xxxx +no_defs' string (related to #1597) --- test/unit/test_io.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/unit/test_io.cpp') diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 46318ffb..0eed2d15 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -8640,6 +8640,17 @@ TEST(io, projparse_init) { .get())); } + { + // Test that +no_defs +type=crs have no effect + auto obj = createFromUserInput("+init=epsg:4326 +no_defs +type=crs", + dbContext, true); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + + auto wkt = crs->exportToWKT(WKTFormatter::create().get()); + EXPECT_TRUE(wkt.find("GEODCRS[\"WGS 84\"") == 0) << wkt; + } + { // EPSG:3040 is normally northing-easting order, but in compatibillity // mode it will be easting-northing -- cgit v1.2.3