aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_crs.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-02 22:27:51 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-02 22:27:51 +0100
commit9577f8e018a7fd3fe57fc934259f441cbf22cb1d (patch)
tree507a0b9a164943eab6c4c8b8e62cb51d5e4b0ef3 /test/unit/test_crs.cpp
parent0ab18674d2b1ea8060ce6eb59c676f9ce98d50fb (diff)
downloadPROJ-9577f8e018a7fd3fe57fc934259f441cbf22cb1d.tar.gz
PROJ-9577f8e018a7fd3fe57fc934259f441cbf22cb1d.zip
identify: improve GeographicCRS identification when the CRS name has no match
Diffstat (limited to 'test/unit/test_crs.cpp')
-rw-r--r--test/unit/test_crs.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index 91ed145c..74f85d50 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -1975,6 +1975,28 @@ TEST(crs, projectedCRS_identify_db) {
EXPECT_EQ(res.front().second, 100);
}
{
+ // Identify from a WKT ESRI with bad PROJCS and GEOGCS names.
+ auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT(
+ "PROJCS[\"Lambert Conformal Conic\",GEOGCS[\"grs80\","
+ "DATUM[\"D_North_American_1983\","
+ "SPHEROID[\"Geodetic_Reference_System_1980\","
+ "6378137,298.257222101]],PRIMEM[\"Greenwich\",0],"
+ "UNIT[\"Degree\",0.017453292519943295]],"
+ "PROJECTION[\"Lambert_Conformal_Conic\"],"
+ "PARAMETER[\"standard_parallel_1\",34.33333333333334],"
+ "PARAMETER[\"standard_parallel_2\",36.16666666666666],"
+ "PARAMETER[\"latitude_of_origin\",33.75],"
+ "PARAMETER[\"central_meridian\",-79],"
+ "PARAMETER[\"false_easting\",609601.22],"
+ "PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]");
+ auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
+ ASSERT_TRUE(crs != nullptr);
+ auto res = crs->identify(factoryEPSG);
+ ASSERT_EQ(res.size(), 1);
+ EXPECT_EQ(res.front().first->getEPSGCode(), 32119);
+ EXPECT_EQ(res.front().second, 70);
+ }
+ {
// No equivalent CRS to input one in result set
auto obj =
PROJStringParser().createFromPROJString("+proj=tmerc +datum=WGS84");