aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cli/testprojinfo_out.dist92
-rw-r--r--test/unit/test_c_api.cpp4
-rw-r--r--test/unit/test_operation.cpp40
3 files changed, 80 insertions, 56 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index ebc59c40..15372803 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -168,9 +168,9 @@ 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
-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
+unknown id, Null geographic offset from NAD27 to NAD83, unknown accuracy, World
Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects
-------------------------------------
@@ -366,13 +366,13 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)",
-------------------------------------
Operation n°5:
-unknown id, Null geographic offset from NAD27 to NAD83, unknown accuracy, World
+EPSG:1462, NAD27 to NAD83 (5), 1.0 m, Canada - Quebec
PROJ string:
-
++proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GS2783v1.QUE +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
WKT2_2018 string:
-COORDINATEOPERATION["Null geographic offset from NAD27 to NAD83",
+COORDINATEOPERATION["NAD27 to NAD83 (5)",
SOURCECRS[
GEOGCRS["NAD27",
DATUM["North American Datum 1927",
@@ -386,12 +386,7 @@ COORDINATEOPERATION["Null geographic offset from NAD27 to NAD83",
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
- ANGLEUNIT["degree",0.0174532925199433]],
- USAGE[
- SCOPE["unknown"],
- AREA["North America - NAD27"],
- BBOX[7.15,167.65,83.17,-47.74]],
- ID["EPSG",4267]]],
+ ANGLEUNIT["degree",0.0174532925199433]]]],
TARGETCRS[
GEOGCRS["NAD83",
DATUM["North American Datum 1983",
@@ -405,35 +400,27 @@ COORDINATEOPERATION["Null geographic offset from NAD27 to NAD83",
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
- ANGLEUNIT["degree",0.0174532925199433]],
- USAGE[
- SCOPE["unknown"],
- AREA["North America - NAD83"],
- BBOX[14.92,167.65,86.46,-47.74]],
- ID["EPSG",4269]]],
- METHOD["Geographic2D offsets",
- ID["EPSG",9619]],
- PARAMETER["Latitude offset",0,
- ANGLEUNIT["degree",0.0174532925199433],
- ID["EPSG",8601]],
- PARAMETER["Longitude offset",0,
- ANGLEUNIT["degree",0.0174532925199433],
- ID["EPSG",8602]],
+ ANGLEUNIT["degree",0.0174532925199433]]]],
+ METHOD["NTv1",
+ ID["EPSG",9614]],
+ PARAMETERFILE["Latitude and longitude difference file","GS2783v1.QUE"],
+ OPERATIONACCURACY[1.0],
USAGE[
SCOPE["unknown"],
- AREA["World"],
- BBOX[-90,-180,90,180]]]
+ AREA["Canada - Quebec"],
+ BBOX[44.99,-79.85,62.62,-57.1]],
+ ID["EPSG",1462]]
-------------------------------------
Operation n°6:
-EPSG:1462, NAD27 to NAD83 (5), 1.0 m, Canada - Quebec
+EPSG:1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec
PROJ string:
-+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GS2783v1.QUE +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
++proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=QUE27-83.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
WKT2_2018 string:
-COORDINATEOPERATION["NAD27 to NAD83 (5)",
+COORDINATEOPERATION["NAD27 to NAD83 (6)",
SOURCECRS[
GEOGCRS["NAD27",
DATUM["North American Datum 1927",
@@ -462,26 +449,26 @@ COORDINATEOPERATION["NAD27 to NAD83 (5)",
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]]]],
- METHOD["NTv1",
- ID["EPSG",9614]],
- PARAMETERFILE["Latitude and longitude difference file","GS2783v1.QUE"],
- OPERATIONACCURACY[1.0],
+ METHOD["NTv2",
+ ID["EPSG",9615]],
+ PARAMETERFILE["Latitude and longitude difference file","QUE27-83.gsb"],
+ OPERATIONACCURACY[1.5],
USAGE[
SCOPE["unknown"],
AREA["Canada - Quebec"],
BBOX[44.99,-79.85,62.62,-57.1]],
- ID["EPSG",1462]]
+ ID["EPSG",1573]]
-------------------------------------
Operation n°7:
-EPSG:1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec
+unknown id, Null geographic offset from NAD27 to NAD83, unknown accuracy, World
PROJ string:
-+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=QUE27-83.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
+
WKT2_2018 string:
-COORDINATEOPERATION["NAD27 to NAD83 (6)",
+COORDINATEOPERATION["Null geographic offset from NAD27 to NAD83",
SOURCECRS[
GEOGCRS["NAD27",
DATUM["North American Datum 1927",
@@ -495,7 +482,12 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)",
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
- ANGLEUNIT["degree",0.0174532925199433]]]],
+ ANGLEUNIT["degree",0.0174532925199433]],
+ USAGE[
+ SCOPE["unknown"],
+ AREA["North America - NAD27"],
+ BBOX[7.15,167.65,83.17,-47.74]],
+ ID["EPSG",4267]]],
TARGETCRS[
GEOGCRS["NAD83",
DATUM["North American Datum 1983",
@@ -509,16 +501,24 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)",
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","QUE27-83.gsb"],
- OPERATIONACCURACY[1.5],
+ ANGLEUNIT["degree",0.0174532925199433]],
+ USAGE[
+ SCOPE["unknown"],
+ AREA["North America - NAD83"],
+ BBOX[14.92,167.65,86.46,-47.74]],
+ ID["EPSG",4269]]],
+ METHOD["Geographic2D offsets",
+ ID["EPSG",9619]],
+ PARAMETER["Latitude offset",0,
+ ANGLEUNIT["degree",0.0174532925199433],
+ ID["EPSG",8601]],
+ PARAMETER["Longitude offset",0,
+ ANGLEUNIT["degree",0.0174532925199433],
+ ID["EPSG",8602]],
USAGE[
SCOPE["unknown"],
- AREA["Canada - Quebec"],
- BBOX[44.99,-79.85,62.62,-57.1]],
- ID["EPSG",1573]]
+ AREA["World"],
+ BBOX[-90,-180,90,180]]]
Testing projinfo -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary
Candidate operations found: 1
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 6205a9b8..8cfed9ad 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -1421,7 +1421,7 @@ TEST_F(CApi, proj_create_operations_with_pivot) {
ASSERT_NE(res, nullptr);
ObjListKeeper keeper_res(res);
EXPECT_EQ(proj_list_get_count(res), 7);
- auto op = proj_list_get(m_ctxt, res, 1);
+ auto op = proj_list_get(m_ctxt, res, 0);
ASSERT_NE(op, nullptr);
ObjectKeeper keeper_op(op);
@@ -1451,7 +1451,7 @@ TEST_F(CApi, proj_create_operations_with_pivot) {
ASSERT_NE(res, nullptr);
ObjListKeeper keeper_res(res);
// includes results from ESRI
- EXPECT_EQ(proj_list_get_count(res), 5);
+ EXPECT_EQ(proj_list_get_count(res), 4);
auto op = proj_list_get(m_ctxt, res, 0);
ASSERT_NE(op, nullptr);
ObjectKeeper keeper_op(op);
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 9a968378..42f8fe76 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -4362,7 +4362,7 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
authFactory->createCoordinateReferenceSystem("4275"), // NTF
authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
ctxt);
- ASSERT_EQ(list.size(), 3U);
+ ASSERT_EQ(list.size(), 2U);
EXPECT_EQ(
list[0]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=push +v_3 +step +proj=axisswap "
@@ -4376,12 +4376,6 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
PROJStringFormatter::Convention::PROJ_5,
authFactory->databaseContext())
.get()),
- "");
- EXPECT_EQ(list[2]->exportToPROJString(
- PROJStringFormatter::create(
- PROJStringFormatter::Convention::PROJ_5,
- authFactory->databaseContext())
- .get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=deg +xy_out=rad +step "
"+proj=hgridshift +grids=ntf_r93.gsb +step +proj=unitconvert "
@@ -6136,7 +6130,8 @@ TEST(operation, compoundCRS_to_compoundCRS_context) {
authFactory->createCoordinateReferenceSystem("7406"),
// NAD83(NSRS2007) + NAVD88 height
authFactory->createCoordinateReferenceSystem("5500"), ctxt);
- ASSERT_EQ(list.size(), 88U);
+ // 152 or 155 depending if the VERTCON grids are there
+ ASSERT_GE(list.size(), 152U);
EXPECT_EQ(list[0]->nameStr(), "NGVD29 height (ftUS) to NAVD88 height (3) + "
"NAD27 to WGS 84 (79) + Inverse of "
"NAD83(NSRS2007) to WGS 84 (1)");
@@ -6147,6 +6142,35 @@ TEST(operation, compoundCRS_to_compoundCRS_context) {
"+step +proj=hgridshift +grids=conus +step +proj=push +v_3 +step "
"+proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap "
"+order=2,1 +step +proj=pop +v_3");
+
+ bool foundApprox = false;
+ for (size_t i = 0; i < list.size(); i++) {
+ auto projString =
+ list[i]->exportToPROJString(PROJStringFormatter::create().get());
+ EXPECT_TRUE(
+ projString.find("+proj=pipeline +step +proj=axisswap +order=2,1 "
+ "+step +proj=unitconvert +xy_in=deg +z_in=us-ft "
+ "+xy_out=rad +z_out=m") == 0)
+ << list[i]->nameStr();
+ if (list[i]->nameStr().find("Transformation from NGVD29 height (ftUS) "
+ "to NAVD88 height (approximate "
+ "transformation)") == 0) {
+ EXPECT_EQ(list[i]->nameStr(),
+ "Transformation from NGVD29 height (ftUS) to NAVD88 "
+ "height (approximate transformation) + NAD27 to WGS 84 "
+ "(79) + Inverse of NAD83(NSRS2007) to WGS 84 (1)");
+ EXPECT_EQ(projString,
+ "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+ "+proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad "
+ "+z_out=m +step +proj=hgridshift +grids=conus +step "
+ "+proj=push +v_3 +step +proj=unitconvert +xy_in=rad "
+ "+xy_out=deg +step +proj=axisswap +order=2,1 +step "
+ "+proj=pop +v_3");
+ foundApprox = true;
+ break;
+ }
+ }
+ EXPECT_TRUE(foundApprox);
}
// ---------------------------------------------------------------------------