diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/cli/testprojinfo_out.dist | 16 | ||||
| -rw-r--r-- | test/unit/test_c_api.cpp | 4 | ||||
| -rw-r--r-- | test/unit/test_factory.cpp | 38 | ||||
| -rw-r--r-- | test/unit/test_operation.cpp | 7 | ||||
| -rw-r--r-- | test/unit/test_operationfactory.cpp | 18 |
5 files changed, 62 insertions, 21 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 596f915c..7569f948 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -342,8 +342,8 @@ COORDINATEOPERATION["Ballpark geographic offset from NAD27 to NAD83", Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary --hide-ballpark Candidate operations found: 9 -DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast. -DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast. +DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast west of 44°W and north of 40°N. +DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast west of 44°W and north of 40°N. DERIVED_FROM(EPSG):1241, NAD27 to NAD83 (1), 0.15 m, United States (USA) - CONUS including EEZ -onshore and offshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming. US Gulf of Mexico (GoM) OCS. DERIVED_FROM(EPSG):1243, NAD27 to NAD83 (2), 0.5 m, United States (USA) - Alaska including EEZ. DERIVED_FROM(EPSG):1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec. @@ -357,7 +357,7 @@ Candidate operations found: 10 ------------------------------------- Operation No. 1: -DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast. +DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast west of 44°W and north of 40°N. PROJ string: +proj=pipeline @@ -404,15 +404,15 @@ COORDINATEOPERATION["NAD27 to NAD83 (4)", OPERATIONACCURACY[1.5], USAGE[ SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], - AREA["Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast."], - BBOX[40.04,-141.01,83.17,-47.74]], + AREA["Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast west of 44°W and north of 40°N."], + BBOX[40,-141.00299072266,83.16267232269,-44]], ID["DERIVED_FROM(EPSG)",1313], REMARK["Uses NTv2 data files. Replaces NTv1 (transformation code 1312) except in Quebec. Input expects longitudes to be positive west; EPSG GeogCRS NAD27 (code 4267) and (code 4269) have longitudes positive east. May be used as tfm to WGS 84 - see code 1693."]] ------------------------------------- Operation No. 2: -DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast. +DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast west of 44°W and north of 40°N. PROJ string: +proj=pipeline @@ -459,8 +459,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (3)", OPERATIONACCURACY[2.0], USAGE[ SCOPE["Historic record only - now superseded - see remarks."], - AREA["Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast."], - BBOX[40.04,-141.01,83.17,-47.74]], + AREA["Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast west of 44°W and north of 40°N."], + BBOX[40,-141.00299072266,83.16267232269,-44]], ID["DERIVED_FROM(EPSG)",1312], REMARK["Uses NTv1 method. Replaced in Quebec by code 1462 and elsewhere in 1997 by NTv2 (transformation code 1313). Input expects longitudes to be positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east."]] diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index fa69c9aa..8fa1b228 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -5021,7 +5021,7 @@ TEST_F(CApi, proj_create_vertical_crs_ex) { ASSERT_TRUE(name != nullptr); EXPECT_EQ(name, std::string("Inverse of UTM zone 11N + " - "Transformation from myVertCRS (ftUS) to myVertCRS + " + "Conversion from myVertCRS (ftUS) to myVertCRS + " "Transformation from myVertCRS to NAD83(2011)")); auto proj_5 = proj_as_proj_string(m_ctxt, P, PJ_PROJ_5, nullptr); @@ -5090,7 +5090,7 @@ TEST_F(CApi, proj_create_vertical_crs_ex_with_geog_crs) { name, std::string("Inverse of UTM zone 11N + " "Ballpark geographic offset from NAD83(2011) to WGS 84 + " - "Transformation from myVertCRS to myVertCRS (metre) + " + "Conversion from myVertCRS to myVertCRS (metre) + " "Transformation from myVertCRS (metre) to WGS 84 + " "Ballpark geographic offset from WGS 84 to NAD83(2011)")); diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 02033a8a..c10c4697 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -1261,7 +1261,7 @@ TEST( auto operations = concatenated->operations(); ASSERT_EQ(operations.size(), 2U); EXPECT_TRUE(operations[0]->isEquivalentTo( - factory->createCoordinateOperation("7972", false).get())); + factory->createCoordinateOperation("7813", false).get())); EXPECT_TRUE(operations[1]->isEquivalentTo( factory->createCoordinateOperation("7969", false).get())); } @@ -1270,6 +1270,42 @@ TEST( TEST( factory, + AuthorityFactory_createCoordinateOperation_concatenated_operation_step_2_and_3_are_conversion) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto op = factory->createCoordinateOperation("7987", false); + auto concatenated = nn_dynamic_pointer_cast<ConcatenatedOperation>(op); + ASSERT_TRUE(concatenated != nullptr); + auto operations = concatenated->operations(); + ASSERT_EQ(operations.size(), 3U); + EXPECT_TRUE(operations[0]->isEquivalentTo( + factory->createCoordinateOperation("7980", false).get())); + EXPECT_TRUE(operations[1]->isEquivalentTo( + factory->createCoordinateOperation("7812", false).get())); + EXPECT_TRUE(operations[2]->isEquivalentTo( + factory->createCoordinateOperation("7813", false).get())); + + EXPECT_EQ(operations[1]->targetCRS()->nameStr(), "KOC WD depth"); + EXPECT_EQ(operations[2]->sourceCRS()->nameStr(), + operations[1]->targetCRS()->nameStr()); + EXPECT_EQ( + concatenated->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=geogoffset +dh=-4.74 " + "+step +proj=axisswap +order=1,2,-3 " + "+step +proj=unitconvert +z_in=m +z_out=ft"); + + EXPECT_EQ(concatenated->inverse()->exportToPROJString( + PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=unitconvert +z_in=ft +z_out=m " + "+step +proj=axisswap +order=1,2,-3 " + "+step +proj=geogoffset +dh=4.74"); +} + +// --------------------------------------------------------------------------- + +TEST( + factory, AuthorityFactory_createCoordinateOperation_concatenated_operation_epsg_9103) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); auto op = factory->createCoordinateOperation("9103", false); diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 2830ea94..f76647e2 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -5302,6 +5302,13 @@ TEST(operation, createChangeVerticalUnit) { // --------------------------------------------------------------------------- +TEST(operation, createChangeVerticalUnitNoconvFactor) { + auto conv = Conversion::createChangeVerticalUnit(PropertyMap()); + EXPECT_TRUE(conv->validateParameters().empty()); +} + +// --------------------------------------------------------------------------- + TEST(operation, createGeographicGeocentric) { auto conv = Conversion::createGeographicGeocentric(PropertyMap()); EXPECT_TRUE(conv->validateParameters().empty()); diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp index 4c204c21..8ef59eb0 100644 --- a/test/unit/test_operationfactory.cpp +++ b/test/unit/test_operationfactory.cpp @@ -3357,7 +3357,7 @@ TEST(operation, NN_NO_CHECK(src), GeographicCRS::EPSG_4979); ASSERT_TRUE(op != nullptr); EXPECT_EQ(op->nameStr(), "axis order change (2D) + " - "Transformation from unknown to unknown + " + "Conversion from unknown to unknown + " "unknown to WGS84 ellipsoidal height"); EXPECT_EQ( op->exportToPROJString(PROJStringFormatter::create().get()), @@ -3719,7 +3719,7 @@ TEST(operation, "Inverse of unnamed + " "Transformation from NAD83 to WGS84 + " "Ballpark geographic offset from WGS 84 to NAD83(2011) + " - "Transformation from NAVD88 height (ftUS) to NAVD88 height + " + "Conversion from NAVD88 height (ftUS) to NAVD88 height + " "Inverse of NAD83(2011) to NAVD88 height (1) + " "Conversion from NAD83(2011) (geog3D) to NAD83(2011) " "(geocentric)") { @@ -4101,7 +4101,7 @@ TEST( EXPECT_EQ(list[0]->nameStr(), "Inverse of unnamed + " "Transformation from NAD83 to WGS84 + " - "NAVD88 height to NAVD88 height (ftUS) + " + "Conversion from NAVD88 height to NAVD88 height (ftUS) + " "Inverse of Transformation from NAD83 to WGS84 + " "unnamed"); auto grids = list[0]->gridsNeeded(dbContext, false); @@ -5304,7 +5304,7 @@ TEST(operation, compoundCRS_to_geogCRS_with_vertical_unit_change) { ASSERT_EQ(listCompoundToGeog.size(), listCompoundMetreToGeog.size()); EXPECT_EQ(listCompoundToGeog[0]->nameStr(), - "Inverse of NAVD88 height to NAVD88 height (ftUS) + " + + "Conversion from NAVD88 height (ftUS) to NAVD88 height + " + listCompoundMetreToGeog[0]->nameStr()); EXPECT_EQ( listCompoundToGeog[0]->exportToPROJString( @@ -5369,7 +5369,7 @@ TEST( ASSERT_GE(listCompoundToGeog.size(), 1U); EXPECT_EQ(listCompoundToGeog[0]->nameStr(), - "Inverse of NAVD88 height to NAVD88 height (ftUS) + " + + "Conversion from NAVD88 height (ftUS) to NAVD88 height + " + listCompoundMetreToGeog[0]->nameStr()); EXPECT_EQ( listCompoundToGeog[0]->exportToPROJString( @@ -5425,7 +5425,7 @@ TEST(operation, compoundCRS_to_geogCRS_with_height_depth_reversal) { ASSERT_EQ(listCompoundToGeog.size(), listCompoundMetreToGeog.size()); EXPECT_EQ(listCompoundToGeog[0]->nameStr(), - "Inverse of NAVD88 height to NAVD88 depth + " + + "Conversion from NAVD88 depth to NAVD88 height + " + listCompoundMetreToGeog[0]->nameStr()); EXPECT_EQ( listCompoundToGeog[0]->exportToPROJString( @@ -5489,8 +5489,7 @@ TEST( ASSERT_EQ(listCompoundToGeog.size(), listCompoundMetreToGeog.size()); EXPECT_EQ(listCompoundToGeog[0]->nameStr(), - "Inverse of NAVD88 height (ftUS) to NAVD88 depth (ftUS) + " - "Inverse of NAVD88 height to NAVD88 height (ftUS) + " + + "Conversion from NAVD88 depth (ftUS) to NAVD88 height + " + listCompoundMetreToGeog[0]->nameStr()); EXPECT_EQ( listCompoundToGeog[0]->exportToPROJString( @@ -5504,8 +5503,7 @@ TEST( .get()), "+step +proj=unitconvert +xy_in=deg +xy_out=rad", "+step +proj=unitconvert +xy_in=deg +xy_out=rad " - "+step +proj=axisswap +order=1,2,-3 " - "+step +proj=unitconvert +z_in=us-ft +z_out=m")); + "+step +proj=affine +s33=-0.304800609601219")); // Check reverse path auto listGeogToCompound = |
