diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-11-29 02:52:22 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-11-29 02:52:38 +0100 |
| commit | 6d9a1a909886762cc99e1d8f289e2b60ea787bf7 (patch) | |
| tree | 96719a4aeb76892404a03e33a087b2e3598a2175 /test/unit/test_operation.cpp | |
| parent | d87573cf62b339f22b24595fd05714f1b4e3bda3 (diff) | |
| download | PROJ-6d9a1a909886762cc99e1d8f289e2b60ea787bf7.tar.gz PROJ-6d9a1a909886762cc99e1d8f289e2b60ea787bf7.zip | |
Preserve EPSG code when importFromWKT WKT1_GDAL of EPSG:3857
Diffstat (limited to 'test/unit/test_operation.cpp')
| -rw-r--r-- | test/unit/test_operation.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 818c10ec..c2e35e89 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -3016,6 +3016,29 @@ TEST(operation, webmerc_import_from_GDAL_wkt1) { // --------------------------------------------------------------------------- +TEST(operation, webmerc_import_from_GDAL_wkt1_with_EPSG_code) { + + auto projCRS = ProjectedCRS::create( + PropertyMap() + .set(IdentifiedObject::NAME_KEY, "Pseudo-Mercator") + .set(Identifier::CODESPACE_KEY, "EPSG") + .set(Identifier::CODE_KEY, "3857"), + GeographicCRS::EPSG_4326, + Conversion::createPopularVisualisationPseudoMercator( + PropertyMap(), Angle(0), Angle(0), Length(0), Length(0)), + CartesianCS::createEastingNorthing(UnitOfMeasure::METRE)); + + auto wkt1 = projCRS->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()); + EXPECT_TRUE(wkt1.find("3857") != std::string::npos) << wkt1; + auto obj = WKTParser().createFromWKT(wkt1); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->identifiers().size(), 1); +} + +// --------------------------------------------------------------------------- + TEST(operation, webmerc_import_from_GDAL_wkt1_EPSG_3785_deprecated) { auto wkt1 = |
