diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-03-11 13:19:15 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-03-11 18:16:36 +0100 |
| commit | 3a69b7be2fa26c3ffb91eb2a3b86deb199da20c3 (patch) | |
| tree | e688b2946e6a83082770991b4846bf8223fc5964 /test/unit/test_crs.cpp | |
| parent | afa573f464a77ee887faa858faf1d963b2087abd (diff) | |
| download | PROJ-3a69b7be2fa26c3ffb91eb2a3b86deb199da20c3.tar.gz PROJ-3a69b7be2fa26c3ffb91eb2a3b86deb199da20c3.zip | |
ProjectedCRS::identify(): tune it to better work with ESRI WKT representation of EPSG:2193
Adresses https://github.com/OSGeo/gdal/issues/2303 by raising the
identification confidence from 25% to 90% (90% means equivalent for
all purposes, but name not strictly the EPSG official one)
Diffstat (limited to 'test/unit/test_crs.cpp')
| -rw-r--r-- | test/unit/test_crs.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index 6ab60270..5f35a5e6 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -2445,6 +2445,33 @@ TEST(crs, projectedCRS_identify_db) { } EXPECT_TRUE(found); } + { + // Identify a ESRI WKT where the EPSG system has Northing/Easting order + auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT( + "PROJCS[\"NZGD2000_New_Zealand_Transverse_Mercator_2000\"," + " GEOGCS[\"GCS_NZGD2000\"," + " DATUM[\"New_Zealand_Geodetic_Datum_2000\"," + " SPHEROID[\"GRS 1980\",6378137,298.2572221010042," + " AUTHORITY[\"EPSG\",\"7019\"]]," + " AUTHORITY[\"EPSG\",\"6167\"]]," + " PRIMEM[\"Greenwich\",0]," + " UNIT[\"degree\",0.0174532925199433]]," + " PROJECTION[\"Transverse_Mercator\"]," + " PARAMETER[\"latitude_of_origin\",0]," + " PARAMETER[\"central_meridian\",173]," + " PARAMETER[\"scale_factor\",0.9996]," + " PARAMETER[\"false_easting\",1600000]," + " PARAMETER[\"false_northing\",10000000]," + " UNIT[\"metre\",1," + " AUTHORITY[\"EPSG\",\"9001\"]]]"); + 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(), 2193); + EXPECT_EQ(res.front().second, 90); + } } // --------------------------------------------------------------------------- |
