diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-03-30 19:44:25 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-03-30 19:48:20 +0200 |
| commit | 9c8dc7e59d0df54b19bc4dcf1293ce2ac49d05a5 (patch) | |
| tree | f9e67a604539553598cfa3b7685982f6190d214a /test/unit/test_crs.cpp | |
| parent | 9d596034ceecb63f290fc6d88bc0f68c1864b05a (diff) | |
| download | PROJ-9c8dc7e59d0df54b19bc4dcf1293ce2ac49d05a5.tar.gz PROJ-9c8dc7e59d0df54b19bc4dcf1293ce2ac49d05a5.zip | |
ESRI_WKT ingestion: make sure to identify to non-deprecated EPSG entry when possible (fixes #2116)
Diffstat (limited to 'test/unit/test_crs.cpp')
| -rw-r--r-- | test/unit/test_crs.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index e5a974bf..2498c533 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -2472,6 +2472,31 @@ TEST(crs, projectedCRS_identify_db) { EXPECT_EQ(res.front().first->getEPSGCode(), 2193); EXPECT_EQ(res.front().second, 90); } + { + // Test case of https://github.com/OSGeo/PROJ/issues/2116 + // The NAD_1983_CSRS_Prince_Edward_Island has entries in the alias + // table under the ESRI authority for deprecated EPSG:2292 and + // non-deprecated EPSG:2954 + auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT( + "PROJCS[\"NAD_1983_CSRS_Prince_Edward_Island\"," + "GEOGCS[\"GCS_North_American_1983_CSRS\"," + "DATUM[\"D_North_American_1983_CSRS\"," + "SPHEROID[\"GRS_1980\",6378137.0,298.257222101]]," + "PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]," + "PROJECTION[\"Double_Stereographic\"]," + "PARAMETER[\"False_Easting\",400000.0]," + "PARAMETER[\"False_Northing\",800000.0]," + "PARAMETER[\"Central_Meridian\",-63.0]," + "PARAMETER[\"Scale_Factor\",0.999912]," + "PARAMETER[\"Latitude_Of_Origin\",47.25],UNIT[\"Meter\",1.0]]"); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + auto factoryAll = AuthorityFactory::create(dbContext, std::string()); + auto res = crs->identify(factoryAll); + ASSERT_EQ(res.size(), 1U); + EXPECT_EQ(res.front().first->getEPSGCode(), 2954); + EXPECT_EQ(res.front().second, 100); + } } // --------------------------------------------------------------------------- |
