diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/cli/testprojinfo_out.dist | 112 | ||||
| -rw-r--r-- | test/unit/test_c_api.cpp | 2 | ||||
| -rw-r--r-- | test/unit/test_factory.cpp | 43 | ||||
| -rw-r--r-- | test/unit/test_operation.cpp | 2 |
4 files changed, 148 insertions, 11 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index f97fde62..c1d9f3e0 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -212,7 +212,7 @@ CONVERSION["UTM zone 31N", Testing projinfo -s NAD27 -t NAD83 Candidate operations found: 1 -Note: using '--spatial-test intersects' would bring more results (8) +Note: using '--spatial-test intersects' would bring more results (10) ------------------------------------- Operation n°1: @@ -267,7 +267,7 @@ COORDINATEOPERATION["Ballpark geographic offset from NAD27 to NAD83", BBOX[-90,-180,90,180]]] Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary -Candidate operations found: 8 +Candidate operations found: 10 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 @@ -276,9 +276,11 @@ EPSG:1462, NAD27 to NAD83 (5), 1.0 m, Canada - Quebec EPSG:1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec EPSG:9111, NAD27 to NAD83 (9), 1.5 m, Canada - Saskatchewan unknown id, Ballpark geographic offset from NAD27 to NAD83, unknown accuracy, World, has ballpark transformation +EPSG:8555, NAD27 to NAD83 (7), 0.15 m, USA - CONUS and GoM +EPSG:8549, NAD27 to NAD83 (8), 0.5 m, USA - Alaska Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects -Candidate operations found: 8 +Candidate operations found: 10 ------------------------------------- Operation n°1: @@ -685,6 +687,110 @@ COORDINATEOPERATION["Ballpark geographic offset from NAD27 to NAD83", AREA["World"], BBOX[-90,-180,90,180]]] +------------------------------------- +Operation n°9: + +EPSG:8555, NAD27 to NAD83 (7), 0.15 m, USA - CONUS and GoM + +PROJ string: + +WKT2:2019 string: +COORDINATEOPERATION["NAD27 to NAD83 (7)", + VERSION["NGS-Usa Conus Nadcon5"], + SOURCECRS[ + GEOGCRS["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]], + ID["EPSG",4267]]], + TARGETCRS[ + GEOGCRS["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]], + ID["EPSG",4269]]], + METHOD["NADCON5 (2D)", + ID["EPSG",1074]], + PARAMETERFILE["Latitude difference file","nadcon5.nad27.nad83_1986.conus.lat.trn.20160901.b"], + PARAMETERFILE["Longitude difference file","nadcon5.nad27.nad83_1986.conus.lon.trn.20160901.b"], + OPERATIONACCURACY[0.15], + USAGE[ + SCOPE["Spatial referencing."], + AREA["USA - CONUS and GoM"], + BBOX[23.82,-124.79,49.38,-66.91]], + ID["EPSG",8555], + REMARK["Uses NADCON5 method which expects longitudes positive east in range 0-360°; source and target CRSs have longitudes positive east in range -180° to +180°. Accuracy at 67% confidence level is 0.15m onshore, 1m nearshore and undetermined farther offshore."]] + +------------------------------------- +Operation n°10: + +EPSG:8549, NAD27 to NAD83 (8), 0.5 m, USA - Alaska + +PROJ string: + +WKT2:2019 string: +COORDINATEOPERATION["NAD27 to NAD83 (8)", + VERSION["NGS-Usa AK Nadcon5"], + SOURCECRS[ + GEOGCRS["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]], + ID["EPSG",4267]]], + TARGETCRS[ + GEOGCRS["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]], + ID["EPSG",4269]]], + METHOD["NADCON5 (2D)", + ID["EPSG",1074]], + PARAMETERFILE["Latitude difference file","nadcon5.nad27.nad83_1986.alaska.lat.trn.20160901.b"], + PARAMETERFILE["Longitude difference file","nadcon5.nad27.nad83_1986.alaska.lon.trn.20160901.b"], + OPERATIONACCURACY[0.5], + USAGE[ + SCOPE["Spatial referencing."], + AREA["USA - Alaska"], + BBOX[51.3,172.42,71.4,-129.99]], + ID["EPSG",8549], + REMARK["Uses NADCON5 method which expects longitudes positive east in range 0-360°; source and target CRSs have longitudes positive east in range -180° to +180°. Accuracy at 67% confidence level is 0.5m onshore, 5m nearshore and undetermined farther offshore."]] + Testing projinfo -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary Candidate operations found: 1 Note: using '--spatial-test intersects' would bring more results (2) diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index d8968e97..8ac5a511 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -1344,7 +1344,7 @@ TEST_F(CApi, proj_create_operations) { ASSERT_NE(res, nullptr); ObjListKeeper keeper_res(res); - EXPECT_EQ(proj_list_get_count(res), 8); + EXPECT_EQ(proj_list_get_count(res), 10); EXPECT_EQ(proj_list_get(m_ctxt, res, -1), nullptr); EXPECT_EQ(proj_list_get(m_ctxt, res, proj_list_get_count(res)), nullptr); diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 7784d8a2..47cee060 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -1116,6 +1116,28 @@ TEST( // --------------------------------------------------------------------------- +TEST( + factory, + AuthorityFactory_createCoordinateOperation_concatenated_operation_epsg_9103) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto op = factory->createCoordinateOperation("9103", false); + auto concatenated = nn_dynamic_pointer_cast<ConcatenatedOperation>(op); + ASSERT_TRUE(concatenated != nullptr); + auto operations = concatenated->operations(); + ASSERT_EQ(operations.size(), + 5U); // we've added an explicit geographic -> geocentric step + EXPECT_EQ(operations[0]->nameStr(), "NAD27 to NAD83 (1)"); + EXPECT_EQ(operations[1]->nameStr(), "NAD83 to NAD83(2011) (1)"); + EXPECT_EQ( + operations[2]->nameStr(), + "Conversion from NAD83(2011) (geog2D) to NAD83(2011) (geocentric)"); + EXPECT_EQ(operations[3]->nameStr(), + "Inverse of ITRF2008 to NAD83(2011) (1)"); + EXPECT_EQ(operations[4]->nameStr(), "ITRF2008 to ITRF2014 (1)"); +} + +// --------------------------------------------------------------------------- + static bool in(const std::string &str, const std::vector<std::string> &list) { for (const auto &listItem : list) { if (str == listItem) { @@ -1514,12 +1536,21 @@ class FactoryWithTmpDatabase : public ::testing::Test { "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); - ASSERT_TRUE(execute( - "INSERT INTO concatenated_operation " - "VALUES('EPSG','DUMMY_CONCATENATED','name',NULL,NULL," - "'EPSG','4326','EPSG'" - ",'4326','EPSG','1262',NULL,'EPSG','DUMMY_OTHER_TRANSFORMATION'" - ",'EPSG','DUMMY_OTHER_TRANSFORMATION',NULL,NULL,NULL,0);")) + ASSERT_TRUE( + execute("INSERT INTO concatenated_operation " + "VALUES('EPSG','DUMMY_CONCATENATED','name',NULL,NULL," + "'EPSG','4326','EPSG'" + ",'4326','EPSG','1262',NULL,NULL,0);")) + << last_error(); + + ASSERT_TRUE(execute("INSERT INTO concatenated_operation_step " + "VALUES('EPSG','DUMMY_CONCATENATED',1," + "'EPSG','DUMMY_OTHER_TRANSFORMATION');")) + << last_error(); + + ASSERT_TRUE(execute("INSERT INTO concatenated_operation_step " + "VALUES('EPSG','DUMMY_CONCATENATED',2," + "'EPSG','DUMMY_OTHER_TRANSFORMATION');")) << last_error(); } diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 53dcb861..8805e6a1 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -4516,7 +4516,7 @@ TEST(operation, geogCRS_to_geogCRS_context_ntv1_ntv2_ctable2) { authFactory->createCoordinateReferenceSystem("4267"), // NAD27 authFactory->createCoordinateReferenceSystem("4269"), // NAD83 ctxt); - ASSERT_EQ(list.size(), 8U); + ASSERT_EQ(list.size(), 10U); EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()), "+proj=pipeline +step +proj=axisswap +order=2,1 +step " "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift " |
