diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-01 17:29:19 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-01 17:53:15 +0100 |
| commit | 18dbc00dc30db7ca5fa7bd6a00115628324dcd0c (patch) | |
| tree | 79da69c780a09929397179dc1e2bd37a10dfe6ad /test/unit/test_operation.cpp | |
| parent | fa11a21801ac1f8afaa768390c46f5226089b090 (diff) | |
| download | PROJ-18dbc00dc30db7ca5fa7bd6a00115628324dcd0c.tar.gz PROJ-18dbc00dc30db7ca5fa7bd6a00115628324dcd0c.zip | |
importFromWKT: deal with uncommon formulation of EPSG:3857
Diffstat (limited to 'test/unit/test_operation.cpp')
| -rw-r--r-- | test/unit/test_operation.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index c2e35e89..bb8221fd 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -3187,6 +3187,44 @@ TEST(operation, webmerc_import_from_WKT2_EPSG_3785_deprecated) { // --------------------------------------------------------------------------- +TEST(operation, webmerc_import_from_broken_esri_WGS_84_Pseudo_Mercator) { + + // Likely the result of a broken export of GDAL morphToESRI() + auto wkt1 = "PROJCS[\"WGS_84_Pseudo_Mercator\",GEOGCS[\"GCS_WGS_1984\"," + "DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\"," + "6378137,298.257223563]],PRIMEM[\"Greenwich\",0]," + "UNIT[\"Degree\",0.017453292519943295]]," + "PROJECTION[\"Mercator\"],PARAMETER[\"central_meridian\",0]," + "PARAMETER[\"false_easting\",0]," + "PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]," + "PARAMETER[\"standard_parallel_1\",0.0]]"; + + auto obj = WKTParser().createFromWKT(wkt1); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + + auto convGot = crs->derivingConversion(); + + EXPECT_EQ(convGot->exportToWKT(WKTFormatter::create().get()), + "CONVERSION[\"unnamed\",\n" + " METHOD[\"Popular Visualisation Pseudo Mercator\",\n" + " ID[\"EPSG\",1024]],\n" + " PARAMETER[\"Latitude of natural origin\",0,\n" + " ANGLEUNIT[\"degree\",0.0174532925199433],\n" + " ID[\"EPSG\",8801]],\n" + " PARAMETER[\"Longitude of natural origin\",0,\n" + " ANGLEUNIT[\"degree\",0.0174532925199433],\n" + " ID[\"EPSG\",8802]],\n" + " PARAMETER[\"False easting\",0,\n" + " LENGTHUNIT[\"metre\",1],\n" + " ID[\"EPSG\",8806]],\n" + " PARAMETER[\"False northing\",0,\n" + " LENGTHUNIT[\"metre\",1],\n" + " ID[\"EPSG\",8807]]]"); +} + +// --------------------------------------------------------------------------- + TEST(operation, mollweide_export) { auto conv = Conversion::createMollweide(PropertyMap(), Angle(1), Length(2), |
