diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-06-29 12:23:37 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-06-30 11:14:46 +0200 |
| commit | a9c3567cf5f69d08a869bf17a9e284e8c8142956 (patch) | |
| tree | c7704fa27b47c2b79e19a23edc6594da02a464d9 /test | |
| parent | 7a131de134e40c73795c7d2c1834bee1e45b16a6 (diff) | |
| download | PROJ-a9c3567cf5f69d08a869bf17a9e284e8c8142956.tar.gz PROJ-a9c3567cf5f69d08a869bf17a9e284e8c8142956.zip | |
Database: import scope/remarks for coordinate operation and add C API
- Import scope and remarks for coordinate operations of the EPSG dataset.
Database size goes from 5.2 MB to 5.55 MB
- Add proj_get_scope() and proj_get_remarks()
Diffstat (limited to 'test')
| -rw-r--r-- | test/cli/testprojinfo_out.dist | 18 | ||||
| -rw-r--r-- | test/unit/test_c_api.cpp | 45 | ||||
| -rw-r--r-- | test/unit/test_factory.cpp | 17 |
3 files changed, 67 insertions, 13 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 4c0e726d..f742fa60 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -279,7 +279,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (3)", PARAMETERFILE["Latitude and longitude difference file","ntv1_can.dat"], OPERATIONACCURACY[1.0], USAGE[ - SCOPE["unknown"], + SCOPE["Historic record only - now superseded - see remarks."], AREA["Canada"], BBOX[40.04,-141.01,86.46,-47.74]], ID["DERIVED_FROM(EPSG)",1312]] @@ -329,7 +329,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (4)", PARAMETERFILE["Latitude and longitude difference file","ntv2_0.gsb"], OPERATIONACCURACY[1.5], USAGE[ - SCOPE["unknown"], + SCOPE["Accuracy 1-2 metres."], AREA["Canada - NAD27"], BBOX[40.04,-141.01,83.17,-47.74]], ID["DERIVED_FROM(EPSG)",1313]] @@ -378,7 +378,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (1)", PARAMETERFILE["Latitude and longitude difference file","conus"], OPERATIONACCURACY[0.15], USAGE[ - SCOPE["unknown"], + SCOPE["Accuracy at 67% confidence level is 0.15m onshore, 5m nearshore and undetermined farther offshore."], AREA["USA - CONUS including EEZ"], BBOX[23.81,-129.17,49.38,-65.69]], ID["DERIVED_FROM(EPSG)",1241]] @@ -427,7 +427,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)", PARAMETERFILE["Latitude and longitude difference file","alaska"], OPERATIONACCURACY[0.5], USAGE[ - SCOPE["unknown"], + SCOPE["Accuracy at 67% confidence level is 0.5m onshore, 5m nearshore and undetermined farther offshore."], AREA["USA - Alaska including EEZ"], BBOX[47.88,167.65,74.71,-129.99]], ID["DERIVED_FROM(EPSG)",1243]] @@ -478,10 +478,11 @@ COORDINATEOPERATION["NAD27 to NAD83 (5)", PARAMETERFILE["Latitude and longitude difference file","GS2783v1.QUE"], OPERATIONACCURACY[1.0], USAGE[ - SCOPE["unknown"], + SCOPE["Historic record only - now superseded - see remarks."], AREA["Canada - Quebec"], BBOX[44.99,-79.85,62.62,-57.1]], - ID["EPSG",1462]] + ID["EPSG",1462], + REMARK["Densification for Quebec of code 1312. Replaced by NAD27 to NAD83 (6) (code 1573). Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east."]] ------------------------------------- Operation n°6: @@ -529,10 +530,11 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)", PARAMETERFILE["Latitude and longitude difference file","QUE27-83.gsb"], OPERATIONACCURACY[1.5], USAGE[ - SCOPE["unknown"], + SCOPE["Accuracy 1-2 metres."], AREA["Canada - Quebec"], BBOX[44.99,-79.85,62.62,-57.1]], - ID["EPSG",1573]] + ID["EPSG",1573], + REMARK["Replaces NAD27 to NAD83 (5) (code 1462). Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east."]] ------------------------------------- Operation n°7: diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 2e6ea2c7..99904fd4 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3375,4 +3375,49 @@ TEST_F(CApi, proj_normalize_for_visualization_with_alternatives_reverse) { EXPECT_NEAR(c.lp.phi, 42, 1e-8); } +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_get_remarks) { + auto co = proj_create_from_database(m_ctxt, "EPSG", "8048", + PJ_CATEGORY_COORDINATE_OPERATION, false, + nullptr); + ObjectKeeper keeper(co); + ASSERT_NE(co, nullptr); + + auto remarks = proj_get_remarks(co); + ASSERT_NE(remarks, nullptr); + EXPECT_EQ( + remarks, + std::string("Scale difference in ppb where 1/billion = 1E-9. " + "Derivation excluded Cocos, Christmas and Macquarie " + "Islands but is applied there. See codes 8444-46 for " + "equivalents using NTv2 method. See code 8447 for " + "alternative including distortion model for Aus only.")); +} + +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_get_scope) { + { + auto co = proj_create_from_database(m_ctxt, "EPSG", "8048", + PJ_CATEGORY_COORDINATE_OPERATION, + false, nullptr); + ObjectKeeper keeper(co); + ASSERT_NE(co, nullptr); + + auto scope = proj_get_scope(co); + ASSERT_NE(scope, nullptr); + EXPECT_EQ(scope, + std::string("Conformal transformation of GDA94 coordinates " + "that have been derived through GNSS CORS.")); + } + { + auto P = proj_create(m_ctxt, "+proj=noop"); + ObjectKeeper keeper(P); + ASSERT_NE(P, nullptr); + auto scope = proj_get_scope(P); + ASSERT_EQ(scope, nullptr); + } +} + } // namespace diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 34c5568c..298dbd4d 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -807,10 +807,14 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_helmert_15_CF) { " ID[\"EPSG\",1047]],\n" " OPERATIONACCURACY[0.03],\n" " USAGE[\n" - " SCOPE[\"unknown\"],\n" + " SCOPE[\"Geodesy. RMS residuals 5mm north, 8mm east and 28mm " + "vertical, maximum residuals 10mm north, 13mm east and 51mm " + "vertical.\"],\n" " AREA[\"Australia - onshore and EEZ\"],\n" " BBOX[-47.2,109.23,-8.88,163.2]],\n" - " ID[\"EPSG\",6276]]"; + " ID[\"EPSG\",6276],\n" + " REMARK[\"Scale difference in ppb and scale difference rate in " + "ppb/yr where 1/billion = 1E-9 or nm/m.\"]]"; EXPECT_EQ( op->exportToWKT( @@ -911,10 +915,13 @@ TEST( "file\",\"RGNC1991_NEA74Noumea.gsb\"],\n" " OPERATIONACCURACY[0.05],\n" " USAGE[\n" - " SCOPE[\"unknown\"],\n" + " SCOPE[\"Accuracy 5-10cm.\"],\n" " AREA[\"New Caledonia - Grande Terre - Noumea\"],\n" " BBOX[-22.37,166.35,-22.19,166.54]],\n" - " ID[\"EPSG\",1295]]"; + " ID[\"EPSG\",1295],\n" + " REMARK[\"Emulation using NTv2 method of tfm NEA74 Noumea to " + "RGNC91-93 (3) (code 15943). Note reversal of sign of parameter values " + "in grid file.\"]]"; EXPECT_EQ( op->exportToWKT( WKTFormatter::create(WKTFormatter::Convention::WKT2_2018).get()), @@ -984,7 +991,7 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_other_transformation) { " ID[\"EPSG\",8602]],\n" " OPERATIONACCURACY[0.0],\n" " USAGE[\n" - " SCOPE[\"unknown\"],\n" + " SCOPE[\"Change of prime meridian.\"],\n" " AREA[\"Europe - Czechoslovakia\"],\n" " BBOX[47.73,12.09,51.06,22.56]],\n" " ID[\"EPSG\",1884]]"; |
