diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-04-14 18:13:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-14 18:13:35 +0200 |
| commit | 43d11bd830932ef18770a53e72fc93f67b3d137c (patch) | |
| tree | 08ac517c89c42641c39702e62fa8ff76bc8075ec /test/unit/test_crs.cpp | |
| parent | 5b017a8a78acc1f8b086ae339ecec257ee9d9684 (diff) | |
| download | PROJ-43d11bd830932ef18770a53e72fc93f67b3d137c.tar.gz PROJ-43d11bd830932ef18770a53e72fc93f67b3d137c.zip | |
ProjectedCRS identification: deal with switched 1st/2nd std parallels for LCC_2SP (#2150)
As switching the 2 standard parallels for Lambert Conformal Conic 2 standard
parallels result in a equivalently numerical projection definition, take
that into account when querying the database.
Diffstat (limited to 'test/unit/test_crs.cpp')
| -rw-r--r-- | test/unit/test_crs.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index 2bde8ee3..ad32d98b 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -2550,6 +2550,30 @@ TEST(crs, projectedCRS_identify_db) { EXPECT_EQ(res.front().first->getEPSGCode(), 2954); EXPECT_EQ(res.front().second, 100); } + { + // Test identification of LCC_2SP with switched standard parallels. + auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT( + "PROJCS[\"foo\",\n" + " GEOGCS[\"RGF93\",\n" + " DATUM[\"Reseau_Geodesique_Francais_1993\",\n" + " SPHEROID[\"GRS 1980\",6378137,298.257222101]],\n" + " PRIMEM[\"Greenwich\",0],\n" + " UNIT[\"degree\",0.0174532925199433]],\n" + " PROJECTION[\"Lambert_Conformal_Conic_2SP\"],\n" + " PARAMETER[\"latitude_of_origin\",46.5],\n" + " PARAMETER[\"central_meridian\",3],\n" + " PARAMETER[\"standard_parallel_1\",44],\n" + " PARAMETER[\"standard_parallel_2\",49],\n" + " PARAMETER[\"false_easting\",700000],\n" + " PARAMETER[\"false_northing\",6600000],\n" + " UNIT[\"metre\",1]]"); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + auto res = crs->identify(factoryEPSG); + ASSERT_EQ(res.size(), 1U); + EXPECT_EQ(res.front().first->getEPSGCode(), 2154); + EXPECT_EQ(res.front().second, 70); + } } // --------------------------------------------------------------------------- |
