aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-06 16:23:07 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-06 16:31:25 +0100
commita9ef3a229c6fef5ef8a05ba521a0237f2ffa6aa6 (patch)
tree8b2cee3e3a7466ff914d705c3fb05cb126c83138 /test
parent25fa18055f43d0881a1a2bf9990c99fecfcbdbb7 (diff)
downloadPROJ-a9ef3a229c6fef5ef8a05ba521a0237f2ffa6aa6.tar.gz
PROJ-a9ef3a229c6fef5ef8a05ba521a0237f2ffa6aa6.zip
Coordinate operation search: add a authority_to_authority_preference table to restrict and prioritize searches
Diffstat (limited to 'test')
-rw-r--r--test/cli/testprojinfo_out.dist53
-rw-r--r--test/unit/test_c_api.cpp6
-rw-r--r--test/unit/test_crs.cpp5
-rw-r--r--test/unit/test_operation.cpp8
4 files changed, 14 insertions, 58 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index f3d4854a..4a760c67 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -110,12 +110,11 @@ CONVERSION["UTM zone 31N",
ID["EPSG",16031]]
Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary
-Candidate operations found: 8
+Candidate operations found: 7
DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 1.0 m, Canada
DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - NAD27
DERIVED_FROM(EPSG):1241, NAD27 to NAD83 (1), 0.15 m, USA - CONUS including EEZ
DERIVED_FROM(EPSG):1243, NAD27 to NAD83 (2), 0.5 m, USA - Alaska including EEZ
-ESRI:108003, NAD_1927_To_NAD_1983_PR_VI, 0.05 m, Caribbean - Puerto Rico and Virgin Islands - onshore
unknown id, Null geographic offset from NAD27 to NAD83, unknown accuracy, World
EPSG:1462, NAD27 to NAD83 (5), 1.0 m, Canada - Quebec
EPSG:1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec
@@ -306,52 +305,6 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)",
-------------------------------------
Operation n°5:
-ESRI:108003, NAD_1927_To_NAD_1983_PR_VI, 0.05 m, Caribbean - Puerto Rico and Virgin Islands - onshore
-
-PROJ string:
-+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=prvi +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
-
-WKT2_2015 string:
-COORDINATEOPERATION["NAD_1927_To_NAD_1983_PR_VI",
- SOURCECRS[
- GEODCRS["NAD27",
- DATUM["North American Datum 1927",
- ELLIPSOID["Clarke 1866",6378206.4,294.978698213898,
- LENGTHUNIT["metre",1]]],
- PRIMEM["Greenwich",0,
- ANGLEUNIT["degree",0.0174532925199433]],
- CS[ellipsoidal,2],
- AXIS["geodetic latitude (Lat)",north,
- ORDER[1],
- ANGLEUNIT["degree",0.0174532925199433]],
- AXIS["geodetic longitude (Lon)",east,
- ORDER[2],
- ANGLEUNIT["degree",0.0174532925199433]]]],
- TARGETCRS[
- GEODCRS["NAD83",
- DATUM["North American Datum 1983",
- ELLIPSOID["GRS 1980",6378137,298.257222101,
- LENGTHUNIT["metre",1]]],
- PRIMEM["Greenwich",0,
- ANGLEUNIT["degree",0.0174532925199433]],
- CS[ellipsoidal,2],
- AXIS["geodetic latitude (Lat)",north,
- ORDER[1],
- ANGLEUNIT["degree",0.0174532925199433]],
- AXIS["geodetic longitude (Lon)",east,
- ORDER[2],
- ANGLEUNIT["degree",0.0174532925199433]]]],
- METHOD["NTv2",
- ID["EPSG",9615]],
- PARAMETERFILE["Latitude and longitude difference file","prvi"],
- OPERATIONACCURACY[0.05],
- AREA["Caribbean - Puerto Rico and Virgin Islands - onshore"],
- BBOX[17.62,-67.97,18.78,-64.25],
- ID["ESRI",108003]]
-
--------------------------------------
-Operation n°6:
-
unknown id, Null geographic offset from NAD27 to NAD83, unknown accuracy, World
PROJ string:
@@ -405,7 +358,7 @@ COORDINATEOPERATION["Null geographic offset from NAD27 to NAD83",
BBOX[-90,-180,90,180]]
-------------------------------------
-Operation n°7:
+Operation n°6:
EPSG:1462, NAD27 to NAD83 (5), 1.0 m, Canada - Quebec
@@ -451,7 +404,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (5)",
ID["EPSG",1462]]
-------------------------------------
-Operation n°8:
+Operation n°7:
EPSG:1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 42d00fa6..20f4180b 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -1146,7 +1146,7 @@ TEST_F(CApi, proj_obj_create_operations) {
ASSERT_NE(res, nullptr);
ObjListKeeper keeper_res(res);
- EXPECT_EQ(proj_obj_list_get_count(res), 8);
+ EXPECT_EQ(proj_obj_list_get_count(res), 7);
EXPECT_EQ(proj_obj_list_get(m_ctxt, res, -1), nullptr);
EXPECT_EQ(proj_obj_list_get(m_ctxt, res, proj_obj_list_get_count(res)),
@@ -1247,7 +1247,7 @@ TEST_F(CApi, proj_obj_create_operations_with_pivot) {
// Restrict pivot to JGD2000
{
- auto ctxt = proj_create_operation_factory_context(m_ctxt, nullptr);
+ auto ctxt = proj_create_operation_factory_context(m_ctxt, "any");
ASSERT_NE(ctxt, nullptr);
ContextKeeper keeper_ctxt(ctxt);
@@ -1263,7 +1263,7 @@ TEST_F(CApi, proj_obj_create_operations_with_pivot) {
proj_obj_create_operations(m_ctxt, source_crs, target_crs, ctxt);
ASSERT_NE(res, nullptr);
ObjListKeeper keeper_res(res);
- // includes 2 results from ESRI
+ // includes results from ESRI
EXPECT_EQ(proj_obj_list_get_count(res), 5);
auto op = proj_obj_list_get(m_ctxt, res, 0);
ASSERT_NE(op, nullptr);
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index 44b84401..9c11ac4c 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -4841,6 +4841,11 @@ TEST(crs, crs_createBoundCRSToWGS84IfPossible) {
"+proj=geocent +ellps=intl "
"+towgs84=324.8,153.6,172.1,0,0,0,0 +units=m +no_defs");
}
+ {
+ auto crs = factory->createCoordinateReferenceSystem("4269"); // NAD83
+ auto bound = crs->createBoundCRSToWGS84IfPossible(dbContext);
+ EXPECT_EQ(bound, crs);
+ }
}
// ---------------------------------------------------------------------------
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 057f1717..e5734cd1 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -5941,7 +5941,7 @@ TEST(operation, IGNF_LAMB1_TO_EPSG_4326) {
AuthorityFactory::create(DatabaseContext::create(), "EPSG")
->createCoordinateReferenceSystem("4326"),
ctxt);
- ASSERT_GE(list2.size(), 4U);
+ ASSERT_GE(list2.size(), 3U);
EXPECT_EQ(replaceAll(list2[0]->exportToPROJString(
PROJStringFormatter::create().get()),
@@ -5950,10 +5950,8 @@ TEST(operation, IGNF_LAMB1_TO_EPSG_4326) {
// The second entry in list2 (list2[1]) uses the
// weird +pm=2.33720833333333 from "NTF (Paris) to NTF (2)"
- // and the third one uses the ESRI geographic offset method with another
- // value
- // so skip to the 4th method
- EXPECT_EQ(replaceAll(list2[3]->exportToPROJString(
+ // so skip to the 3th method
+ EXPECT_EQ(replaceAll(list2[2]->exportToPROJString(
PROJStringFormatter::create().get()),
"0.999877341", "0.99987734"),
list[1]->exportToPROJString(PROJStringFormatter::create().get()));