diff options
| author | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2020-03-27 21:36:38 +0000 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2020-03-27 21:36:38 +0000 |
| commit | 685b28445f16fbfa0937a2a1819a69888e99c522 (patch) | |
| tree | ea00156f89bfc05a9a741b1a991bf2e34b48f45e /test | |
| parent | 7be171d3ef34e8f35f5571d52cc091bb08020234 (diff) | |
| download | PROJ-685b28445f16fbfa0937a2a1819a69888e99c522.tar.gz PROJ-685b28445f16fbfa0937a2a1819a69888e99c522.zip | |
Fix identification of projected CRS whose name is close but not strictly equal to a ESRI alias (fixes #2099)
Diffstat (limited to 'test')
| -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 9cfafdb5..d8e5c17c 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -2500,6 +2500,31 @@ TEST(crs, projectedCRS_identify_db) { EXPECT_EQ(res.front().first->getEPSGCode(), 2876); EXPECT_EQ(res.front().second, 100); } + { + // Test case of https://github.com/OSGeo/PROJ/issues/2099 + // The name of the CRS to identify is + // JGD2011_Japan_Zone_2 + // whereas the official ESRI alias is + // JGD_2011_Japan_Zone_2 + auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT( + "PROJCS[\"JGD2011_Japan_Zone_2\",GEOGCS[\"GCS_JGD_2011\"," + "DATUM[\"D_JGD_2011\"," + "SPHEROID[\"GRS_1980\",6378137.0,298.257222101]]," + "PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]," + "PROJECTION[\"Transverse_Mercator\"]," + "PARAMETER[\"False_Easting\",0.0]," + "PARAMETER[\"False_Northing\",0.0]," + "PARAMETER[\"Central_Meridian\",131]," + "PARAMETER[\"Scale_Factor\",0.9999]," + "PARAMETER[\"Latitude_Of_Origin\",33],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(), 6670); + EXPECT_EQ(res.front().second, 70); + } } // --------------------------------------------------------------------------- |
