diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-08-27 18:33:26 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-08-27 18:35:06 +0200 |
| commit | 3f9c0a0b73d6567b3f05a89e337e5ff9f9d5904a (patch) | |
| tree | 2a3a31cfda89019ee3abce8579fd896012d167e8 /test | |
| parent | cd1d1fbe7b3640188c8fe90bceb96945339dc2a9 (diff) | |
| download | PROJ-3f9c0a0b73d6567b3f05a89e337e5ff9f9d5904a.tar.gz PROJ-3f9c0a0b73d6567b3f05a89e337e5ff9f9d5904a.zip | |
ESRI WKT: add support for import/export of (non interrupted) Goode Homolosine
Issue found during https://github.com/OSGeo/gdal/pull/4355 when it was found
that a WKT with Goode_Homolosine projection parsed as ESRI WKT was mapped
wrongly to Interrupted Goode Homolosine
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/test_io.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index a899482e..72ac1868 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -5722,6 +5722,18 @@ static const struct { {{"False_Easting", 1}, {"False_Northing", 2}, {"Central_Meridian", 3}, + {"Option", 0.0}}, + "Goode Homolosine", + { + {"Longitude of natural origin", 3}, + {"False easting", 1}, + {"False northing", 2}, + }}, + + {"Goode_Homolosine", + {{"False_Easting", 1}, + {"False_Northing", 2}, + {"Central_Meridian", 3}, {"Option", 1.0}}, "Interrupted Goode Homolosine", { @@ -6290,6 +6302,31 @@ TEST(wkt_parse, wkt1_esri_gauss_kruger) { // --------------------------------------------------------------------------- +TEST(wkt_parse, wkt1_esri_goode_homolosine_without_option_0) { + // Not sure if it is really valid to not have PARAMETER["Option",0.0] + // but it seems reasonable to check that we understand that as + // Goode Homolosine and not Interrupted Goode Homolosine (option 1) + auto wkt = "PROJCS[\"unknown\",GEOGCS[\"GCS_unknown\",DATUM[\"D_WGS_1984\"," + "SPHEROID[\"WGS_1984\",6378137.0,298.257223563]]," + "PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]," + "PROJECTION[\"Goode_Homolosine\"]," + "PARAMETER[\"False_Easting\",0.0]," + "PARAMETER[\"False_Northing\",0.0]," + "PARAMETER[\"Central_Meridian\",0.0]," + "UNIT[\"Meter\",1.0]]"; + + auto obj = WKTParser() + .attachDatabaseContext(DatabaseContext::create()) + .createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + + EXPECT_EQ(crs->derivingConversion()->method()->nameStr(), + "Goode Homolosine"); +} + +// --------------------------------------------------------------------------- + TEST(wkt_parse, wkt1_oracle) { // WKT from mdsys.cs_srs Oracle table auto wkt = "PROJCS[\"RGF93 / Lambert-93\", GEOGCS [ \"RGF93\", " |
