From a9b6f39494e6dab0ea02af9d82e7b3d570f5422f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 24 Sep 2020 22:41:59 +0200 Subject: Database: "minimal" update to EPSG v10.003 Content mostly unchanged since v9.9 This update is "minimal" in that it mostly reflects the removal of the 'area' table, replaced now by 'extent', 'scope' and 'usage' Other new aspects of EPSG v10 are left aside. --- test/cli/testprojinfo_out.dist | 39 ++--- test/unit/test_c_api.cpp | 7 +- test/unit/test_factory.cpp | 343 +++++++++++++++++++++++++++++------------ 3 files changed, 266 insertions(+), 123 deletions(-) (limited to 'test') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 5d36f42e..7aa1c59f 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -17,7 +17,7 @@ GEOGCRS["WGS 84", ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], USAGE[ - SCOPE["unknown"], + SCOPE["Horizontal component of 3D system."], AREA["World"], BBOX[-90,-180,90,180]], ID["EPSG",4326]] @@ -51,6 +51,7 @@ GEODCRS["WGS 84", AXIS["geodetic longitude (Lon)",east, ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], + SCOPE["Horizontal component of 3D system."], AREA["World"], BBOX[-90,-180,90,180], ID["EPSG",4326]] @@ -71,7 +72,7 @@ GEOGCRS["WGS 84", ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], USAGE[ - SCOPE["unknown"], + SCOPE["Horizontal component of 3D system."], AREA["World"], BBOX[-90,-180,90,180]], ID["EPSG",4326]] @@ -94,6 +95,7 @@ GEODCRS["WGS 84", AXIS["geodetic longitude (Lon)",east, ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], + SCOPE["Horizontal component of 3D system."], AREA["World"], BBOX[-90,-180,90,180], ID["EPSG",4326]] @@ -113,7 +115,7 @@ GEOGCRS["WGS 84", ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], USAGE[ - SCOPE["unknown"], + SCOPE["Horizontal component of 3D system."], AREA["World"], BBOX[-90,-180,90,180]], ID["EPSG",4326]] @@ -166,6 +168,7 @@ PROJJSON: } ] }, + "scope": "Horizontal component of 3D system.", "area": "World", "bbox": { "south_latitude": -90, @@ -373,7 +376,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (4)", PARAMETERFILE["Latitude and longitude difference file","ca_nrc_ntv2_0.tif"], OPERATIONACCURACY[1.5], USAGE[ - SCOPE["Accuracy 1-2 metres."], + SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], AREA["Canada - NAD27"], BBOX[40.04,-141.01,83.17,-47.74]], ID["DERIVED_FROM(EPSG)",1313]] @@ -422,7 +425,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (1)", PARAMETERFILE["Latitude and longitude difference file","us_noaa_conus.tif"], OPERATIONACCURACY[0.15], USAGE[ - SCOPE["Accuracy at 67% confidence level is 0.15m onshore, 5m nearshore and undetermined farther offshore."], + SCOPE["Transformation of coordinates at 0.2m level of accuracy."], AREA["USA - CONUS including EEZ"], BBOX[23.81,-129.17,49.38,-65.69]], ID["DERIVED_FROM(EPSG)",1241]] @@ -471,7 +474,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)", PARAMETERFILE["Latitude and longitude difference file","us_noaa_alaska.tif"], OPERATIONACCURACY[0.5], USAGE[ - SCOPE["Accuracy at 67% confidence level is 0.5m onshore, 5m nearshore and undetermined farther offshore."], + SCOPE["Geodesy."], AREA["USA - Alaska including EEZ"], BBOX[47.88,167.65,74.71,-129.99]], ID["DERIVED_FROM(EPSG)",1243]] @@ -520,7 +523,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)", PARAMETERFILE["Latitude and longitude difference file","ca_que_mern_na27na83.tif"], OPERATIONACCURACY[1.5], USAGE[ - SCOPE["Accuracy 1-2 metres."], + SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], AREA["Canada - Quebec"], BBOX[44.99,-79.85,62.62,-57.1]], ID["DERIVED_FROM(EPSG)",1573]] @@ -623,7 +626,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (9)", PARAMETERFILE["Latitude and longitude difference file","SK27-83.gsb"], OPERATIONACCURACY[1.5], USAGE[ - SCOPE["Spatial referencing."], + SCOPE["Geodesy."], AREA["Canada - Saskatchewan"], BBOX[49,-110,60.01,-101.34]], ID["EPSG",9111]] @@ -727,7 +730,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (7)", PARAMETERFILE["Longitude difference file","nadcon5.nad27.nad83_1986.conus.lon.trn.20160901.b"], OPERATIONACCURACY[0.15], USAGE[ - SCOPE["Spatial referencing."], + SCOPE["Geodesy."], AREA["USA - CONUS and GoM"], BBOX[23.82,-124.79,49.38,-66.91]], ID["EPSG",8555], @@ -779,7 +782,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (8)", PARAMETERFILE["Longitude difference file","nadcon5.nad27.nad83_1986.alaska.lon.trn.20160901.b"], OPERATIONACCURACY[0.5], USAGE[ - SCOPE["Spatial referencing."], + SCOPE["Geodesy."], AREA["USA - Alaska"], BBOX[51.3,172.42,71.4,-129.99]], ID["EPSG",8549], @@ -816,7 +819,7 @@ Testing projinfo -s EPSG:4230 -t EPSG:4258 --area no_match --summary No area of use matching provided name Testing projinfo -s EPSG:4230 -t EPSG:4258 --area WRONG:CODE --summary -Area of use retrieval failed: area not found +Area of use retrieval failed: extent not found Testing deprecated CRS: projinfo EPSG:26591 Warning: object is deprecated @@ -861,7 +864,7 @@ PROJCRS["Monte Mario (Rome) / Italy zone 1", ORDER[2], LENGTHUNIT["metre",1]], USAGE[ - SCOPE["unknown"], + SCOPE["Engineering survey, topographic mapping."], AREA["Italy - west of 12°E"], BBOX[36.53,5.94,47.04,12]], ID["EPSG",26591]] @@ -936,7 +939,7 @@ COORDINATEOPERATION["Inverse of SWEREF99 to RH2000 height", ID["INVERSE(EPSG)",9665]], PARAMETERFILE["Geoid (height correction) model file","se_lantmateriet_SWEN17_RH2000.tif"], USAGE[ - SCOPE["unknown"], + SCOPE["Not known."], AREA["Sweden - onshore"], BBOX[55.28,10.93,69.07,24.17]], ID["INVERSE(DERIVED_FROM(PROJ))","EPSG_4977_TO_EPSG_5613"]] @@ -960,7 +963,7 @@ PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=us_noaa_g2012ba0.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 Testing NGF IGN69 height to RGF93: projinfo -s EPSG:5720 -t EPSG:4965 -o PROJ -Candidate operations found: 2 +Candidate operations found: 1 ------------------------------------- Operation No. 1: @@ -969,14 +972,6 @@ INVERSE(DERIVED_FROM(EPSG)):8885, Inverse of RGF93 to NGF-IGN69 height (3), 0.01 PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=fr_ign_RAF18.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 -------------------------------------- -Operation No. 2: - -INVERSE(EPSG):10000, Inverse of RGF93 to NGF-IGN69 height (1), 0.5 m, France - mainland onshore - -PROJ string: -+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=ggf97a.txt +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 - Testing EPSG:32631 --3d PROJ.4 string: +proj=utm +zone=31 +datum=WGS84 +units=m +no_defs +type=crs diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 564833db..5c0ac699 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3792,8 +3792,8 @@ TEST_F(CApi, proj_get_scope) { 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.")); + std::string("Transformation of GDA94 coordinates that have " + "been derived through GNSS CORS.")); } // Conversion @@ -3807,8 +3807,7 @@ TEST_F(CApi, proj_get_scope) { auto scope = proj_get_scope(co); ASSERT_NE(scope, nullptr); EXPECT_EQ(scope, - std::string("Large and medium scale topographic mapping " - "and engineering survey.")); + std::string("Engineering survey, topographic mapping.")); } { diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index c34723f2..8881402c 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -835,14 +835,14 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_helmert_15_CF) { " ID[\"EPSG\",1047]],\n" " OPERATIONACCURACY[0.03],\n" " USAGE[\n" - " SCOPE[\"Geodesy. RMS residuals 5mm north, 8mm east and 28mm " - "vertical, maximum residuals 10mm north, 13mm east and 51mm " - "vertical.\"],\n" + " SCOPE[\"Geodesy.\"],\n" " AREA[\"Australia - onshore and EEZ\"],\n" " BBOX[-47.2,109.23,-8.88,163.2]],\n" " ID[\"EPSG\",6276],\n" - " REMARK[\"Scale difference in ppb and scale difference rate in " - "ppb/yr where 1/billion = 1E-9 or nm/m.\"]]"; + " REMARK[\"RMS residuals 5mm north, 8mm east and 28mm vertical, " + "maximum residuals 10mm north, 13mm east and 51mm vertical. Scale " + "difference in ppb and scale difference rate in ppb/yr where " + "1/billion = 1E-9 or nm/m.\"]]"; EXPECT_EQ( op->exportToWKT( @@ -943,12 +943,12 @@ TEST( "file\",\"RGNC1991_NEA74Noumea.gsb\"],\n" " OPERATIONACCURACY[0.05],\n" " USAGE[\n" - " SCOPE[\"Accuracy 5-10cm.\"],\n" + " SCOPE[\"Geodesy.\"],\n" " AREA[\"New Caledonia - Grande Terre - Noumea\"],\n" " BBOX[-22.37,166.35,-22.19,166.54]],\n" " ID[\"EPSG\",1295],\n" " REMARK[\"Emulation using NTv2 method of tfm NEA74 Noumea to " - "RGNC91-93 (3) (code 9328). Note reversal of sign of parameter values " + "RGNC91-93 (3) (code 15943). Note reversal of sign of parameter values " "in grid file.\"]]"; EXPECT_EQ( op->exportToWKT( @@ -1415,10 +1415,13 @@ class FactoryWithTmpDatabase : public ::testing::Test { "0);")) << last_error(); ASSERT_TRUE( - execute("INSERT INTO area " + execute("INSERT INTO extent " "VALUES('EPSG','1262','World','World.',-90.0,90.0,-180." "0,180.0,0);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO scope VALUES('EPSG','1024','Not known.',0);")) + << last_error(); ASSERT_TRUE( execute("INSERT INTO prime_meridian " "VALUES('EPSG','8901','Greenwich',0.0,'EPSG','9102',0);")) @@ -1434,12 +1437,20 @@ class FactoryWithTmpDatabase : public ::testing::Test { << last_error(); ASSERT_TRUE( execute("INSERT INTO geodetic_datum " - "VALUES('EPSG','6326','World Geodetic System 1984','',NULL," - "'EPSG','7030','EPSG','8901','EPSG','1262',NULL,0);")) + "VALUES('EPSG','6326','World Geodetic System 1984',''," + "'EPSG','7030','EPSG','8901',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'geodetic_datum_6326_usage','geodetic_datum'," + "'EPSG','6326','EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE( execute("INSERT INTO vertical_datum VALUES('EPSG','1027','EGM2008 " - "geoid',NULL,NULL,'EPSG','1262',NULL,0);")) + "geoid',NULL,NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'vertical_datum_1027_usage','vertical_datum'," + "'EPSG','1027','EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute("INSERT INTO coordinate_system " "VALUES('EPSG','6422','ellipsoidal',2);")) @@ -1454,8 +1465,12 @@ class FactoryWithTmpDatabase : public ::testing::Test { << last_error(); ASSERT_TRUE( execute("INSERT INTO geodetic_crs VALUES('EPSG','4326','WGS " - "84',NULL,NULL,'geographic " - "2D','EPSG','6422','EPSG','6326','EPSG','1262',NULL,0);")) + "84',NULL,'geographic " + "2D','EPSG','6422','EPSG','6326',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'geodetic_crs4326_usage','geodetic_crs'," + "'EPSG','4326','EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute("INSERT INTO coordinate_system " @@ -1467,8 +1482,11 @@ class FactoryWithTmpDatabase : public ::testing::Test { << last_error(); ASSERT_TRUE( execute("INSERT INTO vertical_crs VALUES('EPSG','3855','EGM2008 " - "height',NULL,NULL,'EPSG','6499','EPSG','1027','EPSG'," - "'1262',0);")) + "height',NULL,'EPSG','6499','EPSG','1027',0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'vertical_crs3855_usage','vertical_crs'," + "'EPSG','3855','EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute("INSERT INTO unit_of_measure " @@ -1477,13 +1495,13 @@ class FactoryWithTmpDatabase : public ::testing::Test { << last_error(); ASSERT_TRUE(execute( - "INSERT INTO area VALUES('EPSG','1933','World - N hemisphere - " + "INSERT INTO extent VALUES('EPSG','1933','World - N hemisphere - " "0°E to 6°E','',0.0,84.0,0.0,6.0,0);")) << last_error(); ASSERT_TRUE(execute( "INSERT INTO conversion VALUES('EPSG','16031','UTM zone " - "31N',NULL,NULL,'EPSG','1933','EPSG','9807','Transverse " + "31N',NULL,'EPSG','9807','Transverse " "Mercator','EPSG','8801','Latitude " "of " "natural origin',0.0,'EPSG','9102','EPSG','8802','Longitude of " @@ -1495,9 +1513,13 @@ class FactoryWithTmpDatabase : public ::testing::Test { "NULL," "NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'conversion16031_usage','conversion'," + "'EPSG','16031','EPSG','1933','EPSG','1024');")) + << last_error(); ASSERT_TRUE(execute( - "INSERT INTO area VALUES('EPSG','2060','World - N hemisphere - " + "INSERT INTO extent VALUES('EPSG','2060','World - N hemisphere - " "0°E to 6°E - by country','',0.0,84.0,0.0,6.0,0);")) << last_error(); @@ -1517,36 +1539,56 @@ class FactoryWithTmpDatabase : public ::testing::Test { ASSERT_TRUE(execute("INSERT INTO projected_crs " "VALUES('EPSG','32631','WGS 84 / UTM zone " - "31N',NULL,NULL,'EPSG','4400','EPSG','4326'," - "'EPSG','16031','" - "EPSG','2060',NULL,0);")) + "31N',NULL,'EPSG','4400','EPSG','4326'," + "'EPSG','16031',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'projected_crs32631_usage','projected_crs'," + "'EPSG','32631','EPSG','2060','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute( "INSERT INTO compound_crs VALUES('EPSG','MY_COMPOUND','WGS 84 + " - "EGM2008 geoid height',NULL,NULL,'EPSG','4326','EPSG','3855'," - "'EPSG','1262',0);")) + "EGM2008 geoid height',NULL,'EPSG','4326','EPSG','3855',0);")) + << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('EPSG'," + "'compound_crsMY_COMPOUND_usage','compound_crs'," + "'EPSG','MY_COMPOUND','EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute( "INSERT INTO helmert_transformation " - "VALUES('EPSG','DUMMY_HELMERT','name',NULL,NULL,'EPSG','9603','" + "VALUES('EPSG','DUMMY_HELMERT','name',NULL,'EPSG','9603','" "Geocentric translations (geog2D domain)','EPSG','4326'," - "'EPSG','4326','EPSG','1262',44.0,-143." + "'EPSG','4326',44.0,-143." "0,-90.0,-294.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('EPSG'," + "'helmert_transformation_DUMMY_HELMERT_usage'," + "'helmert_transformation'," + "'EPSG','DUMMY_HELMERT','EPSG','1262','EPSG','1024');")) + << last_error(); ASSERT_TRUE(execute( "INSERT INTO grid_transformation " - "VALUES('EPSG','DUMMY_GRID_TRANSFORMATION','name',NULL,NULL," + "VALUES('EPSG','DUMMY_GRID_TRANSFORMATION','name',NULL," "'EPSG','9615'" - ",'NTv2','EPSG','4326','EPSG','4326','EPSG','1262',1.0,'EPSG','" + ",'NTv2','EPSG','4326','EPSG','4326',1.0,'EPSG','" "8656','Latitude and longitude difference " "file','nzgd2kgrid0005.gsb',NULL,NULL,NULL,NULL,NULL,NULL,NULL," "0);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('EPSG'," + "'grid_transformation_DUMMY_GRID_TRANSFORMATION_usage'," + "'grid_transformation'," + "'EPSG','DUMMY_GRID_TRANSFORMATION'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); ASSERT_TRUE(execute( "INSERT INTO unit_of_measure VALUES('EPSG','9110','sexagesimal " @@ -1555,21 +1597,33 @@ class FactoryWithTmpDatabase : public ::testing::Test { ASSERT_TRUE(execute( "INSERT INTO other_transformation " - "VALUES('EPSG','DUMMY_OTHER_TRANSFORMATION','name',NULL,NULL," + "VALUES('EPSG','DUMMY_OTHER_TRANSFORMATION','name',NULL," "'EPSG','9601','Longitude rotation'," - "'EPSG','4326','EPSG','4326','EPSG','1262',0.0,'EPSG'" + "'EPSG','4326','EPSG','4326',0.0,'EPSG'" ",'8602','Longitude " "offset',-17.4,'EPSG','9110',NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "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,NULL,0);")) + execute("INSERT INTO usage VALUES('EPSG'," + "'other_transformation_DUMMY_OTHER_TRANSFORMATION_usage'," + "'other_transformation'," + "'EPSG','DUMMY_OTHER_TRANSFORMATION'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); + + ASSERT_TRUE(execute("INSERT INTO concatenated_operation " + "VALUES('EPSG','DUMMY_CONCATENATED','name',NULL," + "'EPSG','4326','EPSG'" + ",'4326',NULL,NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," + "'concatenated_operation_DUMMY_CONCATENATED_usage'," + "'concatenated_operation'," + "'EPSG','DUMMY_CONCATENATED'," + "'EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute("INSERT INTO concatenated_operation_step " @@ -1587,20 +1641,35 @@ class FactoryWithTmpDatabase : public ::testing::Test { const auto vals = std::vector{"SOURCE", "TARGET", "PIVOT"}; for (const auto &val : vals) { - ASSERT_TRUE( - execute("INSERT INTO geodetic_datum " - "VALUES('FOO','" + - val + "','" + val + - "','',NULL," - "'EPSG','7030','EPSG','8901','EPSG','1262',NULL,0);")) + ASSERT_TRUE(execute("INSERT INTO geodetic_datum " + "VALUES('FOO','" + + val + "','" + val + + "',''," + "'EPSG','7030','EPSG','8901',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('FOO'," + "'geodetic_datum_" + + val + "_usage'," + "'geodetic_datum'," + "'FOO','" + + val + "'," + "'EPSG','1262','EPSG','1024');")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO geodetic_crs " "VALUES('NS_" + val + "','" + val + "','" + val + - "',NULL,NULL,'geographic 2D','EPSG','6422'," + "',NULL,'geographic 2D','EPSG','6422'," "'FOO','" + - val + "'," - "'EPSG','1262',NULL,0);")) + val + "',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('FOO'," + "'geodetic_crs_" + + val + "_usage'," + "'geodetic_crs'," + "'NS_" + + val + "','" + val + + "','EPSG','1262','EPSG','1024');")) << last_error(); } } @@ -1612,14 +1681,21 @@ class FactoryWithTmpDatabase : public ::testing::Test { "INSERT INTO helmert_transformation " "VALUES('OTHER','" + src + "_" + dst + "','Transformation from " + src + " to " + dst + - "',NULL,NULL,'EPSG','9603','" + "',NULL,'EPSG','9603','" "Geocentric translations (geog2D domain)','NS_" + src + "','" + src + "','NS_" + dst + "','" + dst + - "','EPSG'" - ",'1262',1.0,0,0,0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL," + "',1.0,0,0,0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'helmert_transformation" + + src + '_' + dst + "_usage'," + "'helmert_transformation'," + "'OTHER','" + + src + "_" + dst + "'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); } void checkSourceToOther() { @@ -1886,14 +1962,22 @@ TEST_F(FactoryWithTmpDatabase, ASSERT_TRUE( execute("INSERT INTO geodetic_crs VALUES('OTHER','OTHER_4326','WGS " - "84',NULL,NULL,'geographic " - "2D','EPSG','6422','EPSG','6326','EPSG','1262',NULL,0);")) + "84',NULL,'geographic " + "2D','EPSG','6422','EPSG','6326',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'geodetic_crs_OTHER_4326_usage','geodetic_crs'," + "'OTHER','OTHER_4326','EPSG','1262','EPSG','1024');")) << last_error(); ASSERT_TRUE(execute("INSERT INTO projected_crs " "VALUES('OTHER','OTHER_32631','WGS 84 / UTM zone " - "31N',NULL,NULL,'EPSG','4400','OTHER','OTHER_4326'," - "'EPSG','16031','EPSG','2060',NULL,0);")) + "31N',NULL,'EPSG','4400','OTHER','OTHER_4326'," + "'EPSG','16031',NULL,0);")) + << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'projected_crs_OTHER_32631_usage','projected_crs'," + "'OTHER','OTHER_32631','EPSG','2060','EPSG','1024');")) << last_error(); auto factoryGeneral = AuthorityFactory::create( @@ -1924,12 +2008,19 @@ TEST_F(FactoryWithTmpDatabase, ASSERT_TRUE(execute( "INSERT INTO grid_transformation " - "VALUES('OTHER','OTHER_GRID_TRANSFORMATION','name',NULL,NULL," + "VALUES('OTHER','OTHER_GRID_TRANSFORMATION','name',NULL," "'EPSG','9615'" - ",'NTv2','EPSG','4326','OTHER','OTHER_4326','EPSG','1262',1.0,'EPSG','" + ",'NTv2','EPSG','4326','OTHER','OTHER_4326',1.0,'EPSG','" "8656','Latitude and longitude difference " "file','nzgd2kgrid0005.gsb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute( + "INSERT INTO usage VALUES('OTHER'," + "'grid_transformation_OTHER_GRID_TRANSFORMATION_usage'," + "'grid_transformation'," + "'OTHER','OTHER_GRID_TRANSFORMATION','EPSG','1262','EPSG','1024');")) + << last_error(); + { auto res = factoryGeneral->createFromCoordinateReferenceSystemCodes( "EPSG", "4326", "OTHER", "OTHER_4326", false, false, false, false); @@ -1956,41 +2047,67 @@ TEST_F(FactoryWithTmpDatabase, ASSERT_TRUE(execute( "INSERT INTO grid_transformation " - "VALUES('OTHER','TRANSFORMATION_10M','TRANSFORMATION_10M',NULL,NULL," + "VALUES('OTHER','TRANSFORMATION_10M','TRANSFORMATION_10M',NULL," "'EPSG','9615'" - ",'NTv2','EPSG','4326','EPSG','4326','EPSG','1262',10.0,'EPSG','" + ",'NTv2','EPSG','4326','EPSG','4326',10.0,'EPSG','" "8656','Latitude and longitude difference " "file','nzgd2kgrid0005.gsb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('OTHER'," + "'grid_transformation_TTRANSFORMATION_10M_usage'," + "'grid_transformation'," + "'OTHER','TRANSFORMATION_10M','EPSG','1262','EPSG','1024');")) + << last_error(); ASSERT_TRUE( execute("INSERT INTO grid_transformation " "VALUES('OTHER','TRANSFORMATION_1M_SMALL_EXTENT','" - "TRANSFORMATION_1M_SMALL_EXTENT',NULL,NULL,'EPSG','9615'" - ",'NTv2','EPSG','4326','EPSG','4326','EPSG','2060',1.0,'EPSG','" + "TRANSFORMATION_1M_SMALL_EXTENT',NULL,'EPSG','9615'" + ",'NTv2','EPSG','4326','EPSG','4326',1.0,'EPSG','" "8656','Latitude and longitude difference " "file','nzgd2kgrid0005.gsb',NULL,NULL,NULL,NULL,NULL,NULL," "NULL,0);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('OTHER'," + "'grid_transformation_TRANSFORMATION_1M_SMALL_EXTENT_usage'," + "'grid_transformation'," + "'OTHER','TRANSFORMATION_1M_SMALL_EXTENT'," + "'EPSG','2060','EPSG','1024');")) + << last_error(); ASSERT_TRUE(execute( "INSERT INTO grid_transformation " - "VALUES('OTHER','TRANSFORMATION_1M','TRANSFORMATION_1M',NULL,NULL," + "VALUES('OTHER','TRANSFORMATION_1M','TRANSFORMATION_1M',NULL," "'EPSG','9615'" - ",'NTv2','EPSG','4326','EPSG','4326','EPSG','1262',1.0,'EPSG','" + ",'NTv2','EPSG','4326','EPSG','4326',1.0,'EPSG','" "8656','Latitude and longitude difference " "file','nzgd2kgrid0005.gsb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('OTHER'," + "'grid_transformation_TRANSFORMATION_1M_usage'," + "'grid_transformation'," + "'OTHER','TRANSFORMATION_1M','EPSG','1262','EPSG','1024');")) + << last_error(); ASSERT_TRUE( execute("INSERT INTO grid_transformation " "VALUES('OTHER','TRANSFORMATION_0.5M_DEPRECATED','" - "TRANSFORMATION_0.5M_DEPRECATED',NULL,NULL,'EPSG','9615'" - ",'NTv2','EPSG','4326','EPSG','4326','EPSG','1262',1.0,'EPSG','" + "TRANSFORMATION_0.5M_DEPRECATED',NULL,'EPSG','9615'" + ",'NTv2','EPSG','4326','EPSG','4326',1.0,'EPSG','" "8656','Latitude and longitude difference " "file','nzgd2kgrid0005.gsb',NULL,NULL,NULL,NULL,NULL,NULL," "NULL,1);")) << last_error(); + ASSERT_TRUE( + execute("INSERT INTO usage VALUES('OTHER'," + "'grid_transformation_TRANSFORMATION_0.5M_DEPRECATED_usage'," + "'grid_transformation'," + "'OTHER','TRANSFORMATION_0.5M_DEPRECATED'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); auto factoryOTHER = AuthorityFactory::create(DatabaseContext::create(m_ctxt), "OTHER"); @@ -2086,14 +2203,20 @@ TEST_F(FactoryWithTmpDatabase, AuthorityFactory_proj_based_transformation) { ASSERT_TRUE(execute( "INSERT INTO other_transformation " - "VALUES('OTHER','FOO','My PROJ string based op',NULL,NULL,'PROJ'," + "VALUES('OTHER','FOO','My PROJ string based op',NULL,'PROJ'," "'PROJString','+proj=pipeline +ellps=WGS84 +step +proj=longlat'," - "'EPSG','4326','EPSG','4326','EPSG','1262',0.0,NULL,NULL,NULL," + "'EPSG','4326','EPSG','4326',0.0,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'other_transformation_FOO_usage'," + "'other_transformation'," + "'OTHER','FOO'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); auto factoryOTHER = AuthorityFactory::create(DatabaseContext::create(m_ctxt), "OTHER"); @@ -2145,16 +2268,22 @@ TEST_F(FactoryWithTmpDatabase, AuthorityFactory_wkt_based_transformation) { ASSERT_TRUE( execute("INSERT INTO other_transformation " - "VALUES('OTHER','FOO','My WKT string based op',NULL,NULL," + "VALUES('OTHER','FOO','My WKT string based op',NULL," "'PROJ','WKT','" + std::string(wkt) + "'," - "'EPSG','4326','EPSG','4326','EPSG','1262',0.0,NULL,NULL,NULL," + "'EPSG','4326','EPSG','4326',0.0,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'other_transformation_FOO_usage'," + "'other_transformation'," + "'OTHER','FOO'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); auto factoryOTHER = AuthorityFactory::create(DatabaseContext::create(m_ctxt), "OTHER"); @@ -2180,16 +2309,22 @@ TEST_F(FactoryWithTmpDatabase, ASSERT_TRUE( execute("INSERT INTO other_transformation " - "VALUES('OTHER','FOO','My WKT string based op',NULL,NULL," + "VALUES('OTHER','FOO','My WKT string based op',NULL," "'PROJ','WKT','" + std::string("invalid_wkt") + "'," - "'EPSG','4326','EPSG','4326','EPSG','1262',0.0,NULL,NULL,NULL," + "'EPSG','4326','EPSG','4326',0.0,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'other_transformation_FOO_usage'," + "'other_transformation'," + "'OTHER','FOO'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); auto factoryOTHER = AuthorityFactory::create(DatabaseContext::create(m_ctxt), "OTHER"); @@ -2208,16 +2343,22 @@ TEST_F(FactoryWithTmpDatabase, ASSERT_TRUE( execute("INSERT INTO other_transformation " - "VALUES('OTHER','FOO','My WKT string based op',NULL,NULL," + "VALUES('OTHER','FOO','My WKT string based op',NULL," "'PROJ','WKT','" + std::string("LOCAL_CS[\"foo\"]") + "'," - "'EPSG','4326','EPSG','4326','EPSG','1262',0.0,NULL,NULL,NULL," + "'EPSG','4326','EPSG','4326',0.0,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER'," + "'other_transformation_FOO_usage'," + "'other_transformation'," + "'OTHER','FOO'," + "'EPSG','1262','EPSG','1024');")) + << last_error(); auto factoryOTHER = AuthorityFactory::create(DatabaseContext::create(m_ctxt), "OTHER"); @@ -2297,40 +2438,40 @@ TEST_F(FactoryWithTmpDatabase, custom_geodetic_crs) { populateWithFakeEPSG(); ASSERT_TRUE(execute("INSERT INTO geodetic_crs VALUES('TEST_NS','TEST','my " - "name TEST',NULL,NULL,'geographic 2D'," - "NULL,NULL,NULL,NULL,NULL,NULL,'+proj=longlat +a=2 " + "name TEST',NULL,'geographic 2D'," + "NULL,NULL,NULL,NULL,'+proj=longlat +a=2 " "+rf=300',0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO geodetic_crs VALUES" "('TEST_NS','TEST_BOUND'," - "'my name TEST',NULL,NULL,'geographic 2D'," - "NULL,NULL,NULL,NULL,NULL,NULL,'+proj=longlat +a=2 " + "'my name TEST',NULL,'geographic 2D'," + "NULL,NULL,NULL,NULL,'+proj=longlat +a=2 " "+rf=300 +towgs84=1,2,3',0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO geodetic_crs VALUES('TEST_NS','TEST_GC'," - "'my name',NULL,NULL,'geocentric',NULL,NULL,NULL,NULL," + "'my name',NULL,'geocentric',NULL,NULL," "NULL,NULL,'+proj=geocent +a=2 +rf=300',0);")) << last_error(); ASSERT_TRUE(execute( "INSERT INTO geodetic_crs " "VALUES('TEST_NS','TEST_REF_ANOTHER','my name TEST_REF_ANOTHER'," - "NULL,NULL," - "'geographic 2D',NULL,NULL,NULL,NULL,NULL,NULL,'TEST_NS:TEST',0);")) + "NULL," + "'geographic 2D',NULL,NULL,NULL,NULL,'TEST_NS:TEST',0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO geodetic_crs " - "VALUES('TEST_NS','TEST_WRONG','my name',NULL,NULL," - "'geographic 2D',NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST_WRONG','my name',NULL," + "'geographic 2D',NULL,NULL,NULL,NULL," "'+proj=merc',0);")) << last_error(); ASSERT_TRUE(execute( "INSERT INTO geodetic_crs " - "VALUES('TEST_NS','TEST_RECURSIVE','my name',NULL,NULL,'geographic 2D'," - "NULL,NULL,NULL,NULL,NULL,NULL,'TEST_NS:TEST_RECURSIVE',0);")) + "VALUES('TEST_NS','TEST_RECURSIVE','my name',NULL,'geographic 2D'," + "NULL,NULL,NULL,NULL,'TEST_NS:TEST_RECURSIVE',0);")) << last_error(); auto factory = @@ -2383,42 +2524,42 @@ TEST_F(FactoryWithTmpDatabase, custom_projected_crs) { populateWithFakeEPSG(); ASSERT_TRUE(execute("INSERT INTO projected_crs " - "VALUES('TEST_NS','TEST','my name',NULL,NULL,NULL," - "NULL,NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST','my name',NULL,NULL," + "NULL,NULL,NULL,NULL,NULL," "'+proj=mbt_s +unused_flag',0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO projected_crs " - "VALUES('TEST_NS','TEST_BOUND','my name',NULL,NULL," - "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST_BOUND','my name',NULL," + "NULL,NULL,NULL,NULL,NULL,NULL," "'+proj=mbt_s +unused_flag +towgs84=1,2,3',0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO projected_crs " - "VALUES('TEST_NS','TEST_WRONG','my name',NULL,NULL," - "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST_WRONG','my name',NULL," + "NULL,NULL,NULL,NULL,NULL,NULL," "'+proj=longlat',0);")) << last_error(); // Unknown ellipsoid ASSERT_TRUE(execute("INSERT INTO projected_crs " - "VALUES('TEST_NS','TEST_MERC','merc',NULL,NULL,NULL," - "NULL,NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST_MERC','merc',NULL,NULL," + "NULL,NULL,NULL,NULL,NULL," "'+proj=merc +x_0=0 +R=1',0);")) << last_error(); // Well-known ellipsoid ASSERT_TRUE(execute("INSERT INTO projected_crs " - "VALUES('TEST_NS','TEST_MERC2','merc2',NULL,NULL,NULL," - "NULL,NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST_MERC2','merc2',NULL,NULL," + "NULL,NULL,NULL,NULL,NULL," "'+proj=merc +x_0=0 +ellps=GRS80',0);")) << last_error(); // WKT1_GDAL ASSERT_TRUE( execute("INSERT INTO projected_crs " - "VALUES('TEST_NS','TEST_WKT1_GDAL','WKT1_GDAL',NULL,NULL,NULL," - "NULL,NULL,NULL,NULL,NULL,NULL,NULL," + "VALUES('TEST_NS','TEST_WKT1_GDAL','WKT1_GDAL',NULL,NULL," + "NULL,NULL,NULL,NULL,NULL," "'" "PROJCS[\"unknown\",\n" " GEOGCS[\"unknown\",\n" @@ -2578,8 +2719,8 @@ TEST(factory, attachExtraDatabases_auxiliary) { sqlite3_exec( dbAux, "INSERT INTO geodetic_crs VALUES('OTHER','OTHER_4326','WGS " - "84',NULL,NULL,'geographic 2D','EPSG','6422','EPSG','6326'," - "'EPSG','1262',NULL,0);", + "84',NULL,'geographic 2D','EPSG','6422','EPSG','6326'," + "NULL,0);", nullptr, nullptr, nullptr) == SQLITE_OK); ASSERT_TRUE(sqlite3_exec(dbAux, "COMMIT", nullptr, nullptr, nullptr) == SQLITE_OK); @@ -2704,26 +2845,34 @@ TEST_F(FactoryWithTmpDatabase, ASSERT_TRUE( execute("INSERT INTO other_transformation " "VALUES('OTHER','PARTIAL_AREA_PERFECT_ACCURACY'," - "'PARTIAL_AREA_PERFECT_ACCURACY',NULL,NULL,'PROJ'," + "'PARTIAL_AREA_PERFECT_ACCURACY',NULL,'PROJ'," "'PROJString','+proj=helmert +x=1'," - "'EPSG','4326','EPSG','4326','EPSG','1933',0.0,NULL,NULL,NULL," + "'EPSG','4326','EPSG','4326',0.0,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER', " + "'1','other_transformation','OTHER','PARTIAL_AREA_" + "PERFECT_ACCURACY','EPSG','1933','EPSG','1024')")) + << last_error(); ASSERT_TRUE( execute("INSERT INTO other_transformation " "VALUES('OTHER','WHOLE_AREA_APPROX_ACCURACY'," - "'WHOLE_AREA_APPROX_ACCURACY',NULL,NULL,'PROJ'," + "'WHOLE_AREA_APPROX_ACCURACY',NULL,'PROJ'," "'PROJString','+proj=helmert +x=2'," - "'EPSG','4326','EPSG','4326','EPSG','1262',1.0,NULL,NULL,NULL," + "'EPSG','4326','EPSG','4326',1.0,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); + ASSERT_TRUE(execute("INSERT INTO usage VALUES('OTHER', " + "'2','other_transformation','OTHER','WHOLE_AREA_APPROX_" + "ACCURACY','EPSG','1262','EPSG','1024')")) + << last_error(); auto dbContext = DatabaseContext::create(m_ctxt); auto authFactory = -- cgit v1.2.3 From 4c992038ea01ead56df12f468f29325f7ca9e43d Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 5 Oct 2020 14:36:33 +0200 Subject: Database: add a reference_frame_epoch column to the geodetic_datum for dynamic datums, but not yet used --- test/unit/test_factory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 8881402c..90990a96 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -1438,7 +1438,7 @@ class FactoryWithTmpDatabase : public ::testing::Test { ASSERT_TRUE( execute("INSERT INTO geodetic_datum " "VALUES('EPSG','6326','World Geodetic System 1984',''," - "'EPSG','7030','EPSG','8901',NULL,0);")) + "'EPSG','7030','EPSG','8901',NULL,NULL,0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," "'geodetic_datum_6326_usage','geodetic_datum'," @@ -1645,7 +1645,7 @@ class FactoryWithTmpDatabase : public ::testing::Test { "VALUES('FOO','" + val + "','" + val + "',''," - "'EPSG','7030','EPSG','8901',NULL,0);")) + "'EPSG','7030','EPSG','8901',NULL,NULL,0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO usage VALUES('FOO'," "'geodetic_datum_" + -- cgit v1.2.3 From 2cfdd6f7fc683517a62147feace1b98b3f587abc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 5 Oct 2020 14:56:41 +0200 Subject: Database: instanciate DynamicGeodeticReferenceFrame (things like ITRFxxx, WGS 84 (Gxxxx), etc.) when possible --- test/unit/test_factory.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 90990a96..6950c88e 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -246,6 +246,8 @@ TEST(factory, AuthorityFactory_createGeodeticDatum) { EXPECT_THROW(factory->createGeodeticDatum("-1"), NoSuchAuthorityCodeException); auto grf = factory->createGeodeticDatum("6326"); + EXPECT_TRUE(nn_dynamic_pointer_cast(grf) == + nullptr); ASSERT_EQ(grf->identifiers().size(), 1U); EXPECT_EQ(grf->identifiers()[0]->code(), "6326"); EXPECT_EQ(*(grf->identifiers()[0]->codeSpace()), "EPSG"); @@ -266,10 +268,22 @@ TEST(factory, AuthorityFactory_createGeodeticDatum) { TEST(factory, AuthorityFactory_createGeodeticDatum_with_publication_date) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); - //'World Geodetic System 1984 (G1762) - auto grf = factory->createGeodeticDatum("1156"); + // North American Datum 1983 + auto grf = factory->createGeodeticDatum("6269"); + EXPECT_TRUE(nn_dynamic_pointer_cast(grf) == + nullptr); EXPECT_TRUE(grf->publicationDate().has_value()); - EXPECT_EQ(grf->publicationDate()->toString(), "2005-01-01"); + EXPECT_EQ(grf->publicationDate()->toString(), "1986-01-01"); +} + +// --------------------------------------------------------------------------- + +TEST(factory, AuthorityFactory_createDynamicGeodeticDatum) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto grf = factory->createGeodeticDatum("1165"); // ITRF 2014 + auto dgrf = nn_dynamic_pointer_cast(grf); + ASSERT_TRUE(dgrf != nullptr); + EXPECT_EQ(dgrf->frameReferenceEpoch().value(), 2010.0); } // --------------------------------------------------------------------------- @@ -747,6 +761,8 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_helmert_15_CF) { " VERSION[\"GA-Aus 2010\"],\n" " SOURCECRS[\n" " GEODCRS[\"ITRF2008\",\n" + " DYNAMIC[\n" + " FRAMEEPOCH[2005]],\n" " DATUM[\"International Terrestrial Reference Frame " "2008\",\n" " ELLIPSOID[\"GRS 1980\",6378137,298.257222101,\n" -- cgit v1.2.3 From 3ed9a613d8da9874f45d2a069686f1fa38c72ad9 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 5 Oct 2020 15:40:20 +0200 Subject: Database: use extended description for extent/area of use, as done by epsg.org WKT export --- test/cli/testprojinfo_out.dist | 166 ++++++++++++++++++++--------------------- test/unit/test_c_api.cpp | 2 +- test/unit/test_factory.cpp | 12 +-- 3 files changed, 91 insertions(+), 89 deletions(-) (limited to 'test') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 7aa1c59f..4ba7304e 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -18,7 +18,7 @@ GEOGCRS["WGS 84", ANGLEUNIT["degree",0.0174532925199433]], USAGE[ SCOPE["Horizontal component of 3D system."], - AREA["World"], + AREA["World."], BBOX[-90,-180,90,180]], ID["EPSG",4326]] @@ -52,7 +52,7 @@ GEODCRS["WGS 84", ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], SCOPE["Horizontal component of 3D system."], - AREA["World"], + AREA["World."], BBOX[-90,-180,90,180], ID["EPSG",4326]] @@ -73,7 +73,7 @@ GEOGCRS["WGS 84", ANGLEUNIT["degree",0.0174532925199433]], USAGE[ SCOPE["Horizontal component of 3D system."], - AREA["World"], + AREA["World."], BBOX[-90,-180,90,180]], ID["EPSG",4326]] @@ -96,7 +96,7 @@ GEODCRS["WGS 84", ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], SCOPE["Horizontal component of 3D system."], - AREA["World"], + AREA["World."], BBOX[-90,-180,90,180], ID["EPSG",4326]] @@ -116,7 +116,7 @@ GEOGCRS["WGS 84", ANGLEUNIT["degree",0.0174532925199433]], USAGE[ SCOPE["Horizontal component of 3D system."], - AREA["World"], + AREA["World."], BBOX[-90,-180,90,180]], ID["EPSG",4326]] @@ -169,7 +169,7 @@ PROJJSON: ] }, "scope": "Horizontal component of 3D system.", - "area": "World", + "area": "World.", "bbox": { "south_latitude": -90, "west_longitude": -180, @@ -187,7 +187,7 @@ Candidate operations found: 1 ------------------------------------- Operation No. 1: -EPSG:16031, UTM zone 31N, 0 m, World - N hemisphere - 0°E to 6°E +EPSG:16031, UTM zone 31N, 0 m, Between 0°E and 6°E, northern hemisphere between equator and 84°N, onshore and offshore. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=utm +zone=31 +ellps=WGS84 @@ -271,22 +271,22 @@ 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):1312, NAD27 to NAD83 (3), 2.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 -DERIVED_FROM(EPSG):1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec -EPSG:1462, NAD27 to NAD83 (5), 2.0 m, Canada - Quebec -EPSG:9111, NAD27 to NAD83 (9), 1.5 m, Canada - Saskatchewan -EPSG:8555, NAD27 to NAD83 (7), 0.15 m, USA - CONUS and GoM -EPSG:8549, NAD27 to NAD83 (8), 0.5 m, USA - Alaska +DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada - onshore and offshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. +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):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. +EPSG:1462, NAD27 to NAD83 (5), 2.0 m, Canada - Quebec. +EPSG:9111, NAD27 to NAD83 (9), 1.5 m, Canada - Saskatchewan. +EPSG:8555, NAD27 to NAD83 (7), 0.15 m, United States (USA) - CONUS onshore - 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 offshore continental shelf (GoM OCS). +EPSG:8549, NAD27 to NAD83 (8), 0.5 m, United States (USA) - Alaska. Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects Candidate operations found: 10 ------------------------------------- Operation No. 1: -DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada +DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada - onshore and offshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=ca_nrc_ntv1_can.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -328,14 +328,14 @@ COORDINATEOPERATION["NAD27 to NAD83 (3)", OPERATIONACCURACY[2.0], USAGE[ SCOPE["Historic record only - now superseded - see remarks."], - AREA["Canada"], + AREA["Canada - onshore and offshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon."], BBOX[40.04,-141.01,86.46,-47.74]], ID["DERIVED_FROM(EPSG)",1312]] ------------------------------------- Operation No. 2: -DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - NAD27 +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. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=ca_nrc_ntv2_0.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -377,14 +377,14 @@ COORDINATEOPERATION["NAD27 to NAD83 (4)", OPERATIONACCURACY[1.5], USAGE[ SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], - AREA["Canada - NAD27"], + 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]], ID["DERIVED_FROM(EPSG)",1313]] ------------------------------------- Operation No. 3: -DERIVED_FROM(EPSG):1241, NAD27 to NAD83 (1), 0.15 m, USA - CONUS including EEZ +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. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=us_noaa_conus.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -426,14 +426,14 @@ COORDINATEOPERATION["NAD27 to NAD83 (1)", OPERATIONACCURACY[0.15], USAGE[ SCOPE["Transformation of coordinates at 0.2m level of accuracy."], - AREA["USA - CONUS including EEZ"], + AREA["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."], BBOX[23.81,-129.17,49.38,-65.69]], ID["DERIVED_FROM(EPSG)",1241]] ------------------------------------- Operation No. 4: -DERIVED_FROM(EPSG):1243, NAD27 to NAD83 (2), 0.5 m, USA - Alaska including EEZ +DERIVED_FROM(EPSG):1243, NAD27 to NAD83 (2), 0.5 m, United States (USA) - Alaska including EEZ. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=us_noaa_alaska.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -475,14 +475,14 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)", OPERATIONACCURACY[0.5], USAGE[ SCOPE["Geodesy."], - AREA["USA - Alaska including EEZ"], + AREA["United States (USA) - Alaska including EEZ."], BBOX[47.88,167.65,74.71,-129.99]], ID["DERIVED_FROM(EPSG)",1243]] ------------------------------------- Operation No. 5: -DERIVED_FROM(EPSG):1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec +DERIVED_FROM(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=ca_que_mern_na27na83.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -524,14 +524,14 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)", OPERATIONACCURACY[1.5], USAGE[ SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], - AREA["Canada - Quebec"], + AREA["Canada - Quebec."], BBOX[44.99,-79.85,62.62,-57.1]], ID["DERIVED_FROM(EPSG)",1573]] ------------------------------------- Operation No. 6: -EPSG:1462, NAD27 to NAD83 (5), 2.0 m, Canada - Quebec +EPSG:1462, NAD27 to NAD83 (5), 2.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 @@ -575,7 +575,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (5)", OPERATIONACCURACY[2.0], USAGE[ SCOPE["Historic record only - now superseded - see remarks."], - AREA["Canada - Quebec"], + AREA["Canada - Quebec."], BBOX[44.99,-79.85,62.62,-57.1]], 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."]] @@ -583,7 +583,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (5)", ------------------------------------- Operation No. 7: -EPSG:9111, NAD27 to NAD83 (9), 1.5 m, Canada - Saskatchewan +EPSG:9111, NAD27 to NAD83 (9), 1.5 m, Canada - Saskatchewan. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=SK27-83.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -627,7 +627,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (9)", OPERATIONACCURACY[1.5], USAGE[ SCOPE["Geodesy."], - AREA["Canada - Saskatchewan"], + AREA["Canada - Saskatchewan."], BBOX[49,-110,60.01,-101.34]], ID["EPSG",9111]] @@ -687,7 +687,7 @@ COORDINATEOPERATION["Ballpark geographic offset from NAD27 to NAD83", ------------------------------------- Operation No. 9: -EPSG:8555, NAD27 to NAD83 (7), 0.15 m, USA - CONUS and GoM +EPSG:8555, NAD27 to NAD83 (7), 0.15 m, United States (USA) - CONUS onshore - 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 offshore continental shelf (GoM OCS). PROJ string: @@ -731,7 +731,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (7)", OPERATIONACCURACY[0.15], USAGE[ SCOPE["Geodesy."], - AREA["USA - CONUS and GoM"], + AREA["United States (USA) - CONUS onshore - 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 offshore continental shelf (GoM OCS)."], 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."]] @@ -739,7 +739,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (7)", ------------------------------------- Operation No. 10: -EPSG:8549, NAD27 to NAD83 (8), 0.5 m, USA - Alaska +EPSG:8549, NAD27 to NAD83 (8), 0.5 m, United States (USA) - Alaska. PROJ string: @@ -783,7 +783,7 @@ COORDINATEOPERATION["NAD27 to NAD83 (8)", OPERATIONACCURACY[0.5], USAGE[ SCOPE["Geodesy."], - AREA["USA - Alaska"], + AREA["United States (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."]] @@ -791,29 +791,29 @@ COORDINATEOPERATION["NAD27 to NAD83 (8)", 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) -EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore +EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore. Testing projinfo -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary Candidate operations found: 1 Note: using '--spatial-test intersects' would bring more results (2) -EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore +EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore. Testing projinfo -s EPSG:4230 -t EPSG:4258 --area 'Denmark - onshore' --summary Candidate operations found: 1 Note: using '--spatial-test intersects' would bring more results (2) -EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore +EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore. Testing projinfo -s EPSG:4230 -t EPSG:4258 --area 'Denmark -' --summary Several candidates area of use matching provided name : - EPSG:2531 : Denmark - onshore Jutland and Funen - EPSG:2532 : Denmark - onshore Zealand and Lolland - EPSG:2533 : Denmark - onshore Bornholm - EPSG:3237 : Denmark - onshore - EPSG:3471 : Denmark - onshore west of 12°E - EPSG:3472 : Denmark - onshore east of 12°E - EPSG:3631 : Denmark - onshore Jutland west of 10°E - EPSG:3632 : Denmark - onshore Jutland east of 9°E and Funen - EPSG:4575 : Denmark - onshore Jutland, Funen, Zealand and Lolland + EPSG:2531 : Denmark - Jutland and Funen - onshore. + EPSG:2532 : Denmark - Zealand and Lolland (onshore). + EPSG:2533 : Denmark - Bornholm onshore. + EPSG:3237 : Denmark - onshore. + EPSG:3471 : Denmark - onshore west of 12°E - Zealand, Jutland, Fuen and Lolland. + EPSG:3472 : Denmark - onshore east of 12°E - Zealand and Falster, Bornholm. + EPSG:3631 : Denmark - Jutland onshore west of 10°E. + EPSG:3632 : Denmark - onshore - Jutland east of 9°E and Funen. + EPSG:4575 : Denmark - onshore Jutland, Funen, Zealand and Lolland. Testing projinfo -s EPSG:4230 -t EPSG:4258 --area no_match --summary No area of use matching provided name @@ -865,7 +865,7 @@ PROJCRS["Monte Mario (Rome) / Italy zone 1", LENGTHUNIT["metre",1]], USAGE[ SCOPE["Engineering survey, topographic mapping."], - AREA["Italy - west of 12°E"], + AREA["Italy - onshore and offshore - west of 12°E."], BBOX[36.53,5.94,47.04,12]], ID["EPSG",26591]] @@ -903,7 +903,7 @@ Candidate operations found: 1 ------------------------------------- Operation No. 1: -INVERSE(DERIVED_FROM(PROJ)):EPSG_4977_TO_EPSG_5613, Inverse of SWEREF99 to RH2000 height, unknown accuracy, Sweden - onshore +INVERSE(DERIVED_FROM(PROJ)):EPSG_4977_TO_EPSG_5613, Inverse of SWEREF99 to RH2000 height, unknown accuracy, Sweden - onshore. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=se_lantmateriet_SWEN17_RH2000.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -940,7 +940,7 @@ COORDINATEOPERATION["Inverse of SWEREF99 to RH2000 height", PARAMETERFILE["Geoid (height correction) model file","se_lantmateriet_SWEN17_RH2000.tif"], USAGE[ SCOPE["Not known."], - AREA["Sweden - onshore"], + AREA["Sweden - onshore."], BBOX[55.28,10.93,69.07,24.17]], ID["INVERSE(DERIVED_FROM(PROJ))","EPSG_4977_TO_EPSG_5613"]] @@ -949,7 +949,7 @@ Candidate operations found: 2 ------------------------------------- Operation No. 1: -unknown id, Inverse of NAD83(2011) to NAVD88 height (3), 0.015 m, USA - CONUS - onshore +unknown id, Inverse of NAD83(2011) to NAVD88 height (3), 0.015 m, United States (USA) - CONUS onshore - 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. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=us_noaa_g2018u0.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -957,7 +957,7 @@ PROJ string: ------------------------------------- Operation No. 2: -unknown id, Inverse of NAD83(2011) to NAVD88 height (2), 0.02 m, USA - Alaska +unknown id, Inverse of NAD83(2011) to NAVD88 height (2), 0.02 m, United States (USA) - Alaska. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=us_noaa_g2012ba0.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -967,7 +967,7 @@ Candidate operations found: 1 ------------------------------------- Operation No. 1: -INVERSE(DERIVED_FROM(EPSG)):8885, Inverse of RGF93 to NGF-IGN69 height (3), 0.01 m, France - mainland onshore +INVERSE(DERIVED_FROM(EPSG)):8885, Inverse of RGF93 to NGF-IGN69 height (3), 0.01 m, France - mainland onshore. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=fr_ign_RAF18.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -1020,64 +1020,64 @@ PROJCRS["WGS 84 / UTM zone 31N", Testing -s EPSG:32631 -t EPSG:4326+3855 --summary Candidate operations found: 3 -unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (1), 1 m, World -unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (2), 0.5 m, World +unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (1), 1 m, World. +unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (2), 0.5 m, World. unknown id, Inverse of UTM zone 31N + Inverse of Transformation from EGM2008 height to WGS 84 (ballpark vertical transformation, without ellipsoid height to vertical height correction), unknown accuracy, World, has ballpark transformation Testing -s EPSG:32631 -t EPSG:4326+3855 --3d --summary Candidate operations found: 3 -unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (1), 1 m, World -unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (2), 0.5 m, World +unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (1), 1 m, World. +unknown id, Inverse of UTM zone 31N + WGS 84 to EGM2008 height (2), 0.5 m, World. unknown id, Inverse of UTM zone 31N + Inverse of Transformation from EGM2008 height to WGS 84 (ballpark vertical transformation, without ellipsoid height to vertical height correction), unknown accuracy, World, has ballpark transformation Testing -s EPSG:4936 -t EPSG:4978 --spatial-test intersects --summary where WGS 84 to ETRS89 (2) uses a transformation method not supported by PROJ currently (time-specific Helmert), and thus must be sorted last Candidate operations found: 2 unknown id, Ballpark geocentric translation from ETRS89 to WGS 84, unknown accuracy, World, has ballpark transformation -INVERSE(EPSG):9225, Inverse of WGS 84 to ETRS89 (2), 0.1 m, Europe - offshore North Sea - Germany and Netherlands east of 5°E +INVERSE(EPSG):9225, Inverse of WGS 84 to ETRS89 (2), 0.1 m, Germany - offshore North Sea. Netherlands - offshore east of 5E. Testing -s +proj=longlat +datum=WGS84 +geoidgrids=@foo.gtx +type=crs -t EPSG:4326 -o PROJ -q +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=@foo.gtx +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 Testing -s "GDA94" -t "WGS 84 (G1762)" --spatial-test intersects --summary. Should include transformations through ITRF2008 and GDA2020 Candidate operations found: 7 -unknown id, GDA94 to GDA2020 (1) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.21 m, Australia - GDA -unknown id, GDA94 to WGS 84 (1) + WGS 84 to WGS 84 (G1762), 5 m, Australia - GDA -unknown id, Conversion from GDA94 (geog2D) to GDA94 (geocentric) + Inverse of ITRF2008 to GDA94 (1) + Inverse of WGS 84 (G1762) to ITRF2008 (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.04 m, Australia - onshore and EEZ -unknown id, GDA94 to GDA2020 (3) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Australia - onshore -unknown id, GDA94 to GDA2020 (2) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Australia - onshore -unknown id, GDA94 to GDA2020 (5) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Cocos (Keeling) Islands - onshore -unknown id, GDA94 to GDA2020 (4) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Christmas Island - onshore +unknown id, GDA94 to GDA2020 (1) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.21 m, Australia including Lord Howe Island, Macquarie Islands, Ashmore and Cartier Islands, Christmas Island, Cocos (Keeling) Islands, Norfolk Island. All onshore and offshore. +unknown id, GDA94 to WGS 84 (1) + WGS 84 to WGS 84 (G1762), 5 m, Australia including Lord Howe Island, Macquarie Islands, Ashmore and Cartier Islands, Christmas Island, Cocos (Keeling) Islands, Norfolk Island. All onshore and offshore. +unknown id, Conversion from GDA94 (geog2D) to GDA94 (geocentric) + Inverse of ITRF2008 to GDA94 (1) + Inverse of WGS 84 (G1762) to ITRF2008 (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.04 m, Australia - onshore and offshore to 200 nautical mile EEZ boundary. Includes Lord Howe Island, Ashmore and Cartier Islands. +unknown id, GDA94 to GDA2020 (3) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Australia - Australian Capital Territory; New South Wales; Northern Territory; Queensland; South Australia; Tasmania; Western Australia; Victoria. +unknown id, GDA94 to GDA2020 (2) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Australia - Australian Capital Territory; New South Wales; Northern Territory; Queensland; South Australia; Tasmania; Western Australia; Victoria. +unknown id, GDA94 to GDA2020 (5) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Cocos (Keeling) Islands - onshore. +unknown id, GDA94 to GDA2020 (4) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Christmas Island - onshore. Testing -s "AGD66" -t "WGS 84 (G1762)" --spatial-test intersects --summary. Should include a transformation through GDA2020 Candidate operations found: 14 -unknown id, AGD66 to WGS 84 (18) + WGS 84 to WGS 84 (G1762), 5 m, Australia - offshore -unknown id, AGD66 to WGS 84 (16) + WGS 84 to WGS 84 (G1762), 7 m, Australia - onshore -unknown id, AGD66 to WGS 84 (20) + WGS 84 to WGS 84 (G1762), 11 m, Australia - onshore -unknown id, AGD66 to WGS 84 (15) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Northern Territory -unknown id, AGD66 to WGS 84 (13) + WGS 84 to WGS 84 (G1762), 3 m, Australia - New South Wales and Victoria -unknown id, AGD66 to WGS 84 (21) + WGS 84 to WGS 84 (G1762), 7 m, Papua New Guinea - mainland onshore -unknown id, AGD66 to WGS 84 (14) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Tasmania -unknown id, AGD66 to WGS 84 (19) + WGS 84 to WGS 84 (G1762), 4 m, Papua New Guinea - PFTB -unknown id, AGD66 to WGS 84 (22) + WGS 84 to WGS 84 (G1762), 6 m, Papua New Guinea - PFTB -unknown id, AGD66 to WGS 84 (23) + WGS 84 to WGS 84 (G1762), 6 m, Papua New Guinea - North Fly -unknown id, AGD66 to GDA2020 (1) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Australia - Australian Capital Territory -unknown id, AGD66 to WGS 84 (12) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Australian Capital Territory -unknown id, AGD66 to WGS 84 (17) + WGS 84 to WGS 84 (G1762), 3 m, Australia - onshore +unknown id, AGD66 to WGS 84 (18) + WGS 84 to WGS 84 (G1762), 5 m, Australia - offshore including EEZ. +unknown id, AGD66 to WGS 84 (16) + WGS 84 to WGS 84 (G1762), 7 m, Australia - Australian Capital Territory; New South Wales; Northern Territory; Queensland; South Australia; Tasmania; Western Australia; Victoria. +unknown id, AGD66 to WGS 84 (20) + WGS 84 to WGS 84 (G1762), 11 m, Australia - Australian Capital Territory; New South Wales; Northern Territory; Queensland; South Australia; Tasmania; Western Australia; Victoria. +unknown id, AGD66 to WGS 84 (15) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Northern Territory. +unknown id, AGD66 to WGS 84 (13) + WGS 84 to WGS 84 (G1762), 3 m, Australia - New South Wales and Victoria. +unknown id, AGD66 to WGS 84 (21) + WGS 84 to WGS 84 (G1762), 7 m, Papua New Guinea - mainland onshore. +unknown id, AGD66 to WGS 84 (14) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Tasmania including islands - onshore. +unknown id, AGD66 to WGS 84 (19) + WGS 84 to WGS 84 (G1762), 4 m, Papua New Guinea - Papuan fold and thrust belt. +unknown id, AGD66 to WGS 84 (22) + WGS 84 to WGS 84 (G1762), 6 m, Papua New Guinea - Papuan fold and thrust belt. +unknown id, AGD66 to WGS 84 (23) + WGS 84 to WGS 84 (G1762), 6 m, Papua New Guinea - North Fly area (between 5°04'S and 6°36'S and west of 141°32'E). +unknown id, AGD66 to GDA2020 (1) + Conversion from GDA2020 (geog2D) to GDA2020 (geocentric) + GDA2020 to WGS 84 (G1762) (1) + Conversion from WGS 84 (G1762) (geocentric) to WGS 84 (G1762) (geog2D), 0.25 m, Australia - Australian Capital Territory. +unknown id, AGD66 to WGS 84 (12) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Australian Capital Territory. +unknown id, AGD66 to WGS 84 (17) + WGS 84 to WGS 84 (G1762), 3 m, Australia - Australian Capital Territory; New South Wales; Northern Territory; Queensland; South Australia; Tasmania; Western Australia; Victoria. unknown id, Ballpark geographic offset from AGD66 to WGS 84 (G1762), unknown accuracy, World, has ballpark transformation Testing -s EPSG:31467 -t ETRS89 --spatial-test intersects --grid-check none --bbox 8,48,9,49 --summary. Should include both DHDN to ETRS89 (8) and DHDN to ETRS89 (BWTA2017) Candidate operations found: 4 -unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (9), 0.1 m, Germany - Baden-Wurttemberg -unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (8), 0.9 m, Germany - onshore -unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (3), 1 m, Germany - West Germany S -unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (2), 3 m, Germany - West Germany all states +unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (9), 0.1 m, Germany - Baden-Wurttemberg. +unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (8), 0.9 m, Germany - onshore - states of Baden-Wurtemberg, Bayern, Berlin, Brandenburg, Bremen, Hamburg, Hessen, Mecklenburg-Vorpommern, Niedersachsen, Nordrhein-Westfalen, Rheinland-Pfalz, Saarland, Sachsen, Sachsen-Anhalt, Schleswig-Holstein, Thuringen. +unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (3), 1 m, Germany - states of former West Germany - south of 50°20'N. +unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (2), 3 m, Germany - states of former West Germany onshore - Baden-Wurtemberg, Bayern, Bremen, Hamburg, Hessen, Niedersachsen, Nordrhein-Westfalen, Rheinland-Pfalz, Saarland, Schleswig-Holstein. Testing -s "GDA94" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects Candidate operations found: 1 ------------------------------------- Operation No. 1: -DERIVED_FROM(EPSG):5656, GDA94 to AHD height (49), 0.15 m, Australia - mainland +DERIVED_FROM(EPSG):5656, GDA94 to AHD height (49), 0.15 m, Australia - Australian Capital Territory; New South Wales; Northern Territory; Queensland; South Australia; Western Australia; Victoria. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=vgridshift +grids=au_ga_AUSGeoid09_V1.01.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -1087,7 +1087,7 @@ Candidate operations found: 1 ------------------------------------- Operation No. 1: -DERIVED_FROM(EPSG):8451, GDA2020 to AHD height (1), 0.15 m, Australia Christmas and Cocos - onshore +DERIVED_FROM(EPSG):8451, GDA2020 to AHD height (1), 0.15 m, Australia - Australian Capital Territory, New South Wales, Northern Territory, Queensland, South Australia, Tasmania, Western Australia and Victoria - onshore. Christmas Island - onshore. Cocos and Keeling Islands - onshore. PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=vgridshift +grids=au_ga_AUSGeoid2020_20180201.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 5c0ac699..c20aec39 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -1929,7 +1929,7 @@ TEST_F(CApi, proj_get_area_of_use) { EXPECT_EQ(e, 180); EXPECT_EQ(n, 90); ASSERT_TRUE(name != nullptr); - EXPECT_EQ(std::string(name), "World"); + EXPECT_EQ(std::string(name), "World."); } { auto obj = proj_create(m_ctxt, "+proj=longlat +type=crs"); diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 6950c88e..5ddc2387 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -218,7 +218,7 @@ TEST(factory, AuthorityFactory_createExtent) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); EXPECT_THROW(factory->createExtent("-1"), NoSuchAuthorityCodeException); auto extent = factory->createExtent("1262"); - EXPECT_EQ(*(extent->description()), "World"); + EXPECT_EQ(*(extent->description()), "World."); const auto &geogElts = extent->geographicElements(); ASSERT_EQ(geogElts.size(), 1U); auto bbox = nn_dynamic_pointer_cast(geogElts[0]); @@ -234,7 +234,7 @@ TEST(factory, AuthorityFactory_createExtent) { TEST(factory, AuthorityFactory_createExtent_no_bbox) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); auto extent = factory->createExtent("1361"); // Sudan - south. Deprecated - EXPECT_EQ(*(extent->description()), "Sudan - south"); + EXPECT_EQ(*(extent->description()), "Sudan - south."); const auto &geogElts = extent->geographicElements(); EXPECT_TRUE(geogElts.empty()); } @@ -852,7 +852,9 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_helmert_15_CF) { " OPERATIONACCURACY[0.03],\n" " USAGE[\n" " SCOPE[\"Geodesy.\"],\n" - " AREA[\"Australia - onshore and EEZ\"],\n" + " AREA[\"Australia - onshore and offshore to 200 nautical mile " + "EEZ boundary. Includes Lord Howe Island, Ashmore and Cartier " + "Islands.\"],\n" " BBOX[-47.2,109.23,-8.88,163.2]],\n" " ID[\"EPSG\",6276],\n" " REMARK[\"RMS residuals 5mm north, 8mm east and 28mm vertical, " @@ -960,7 +962,7 @@ TEST( " OPERATIONACCURACY[0.05],\n" " USAGE[\n" " SCOPE[\"Geodesy.\"],\n" - " AREA[\"New Caledonia - Grande Terre - Noumea\"],\n" + " AREA[\"New Caledonia - Grande Terre - Noumea district.\"],\n" " BBOX[-22.37,166.35,-22.19,166.54]],\n" " ID[\"EPSG\",1295],\n" " REMARK[\"Emulation using NTv2 method of tfm NEA74 Noumea to " @@ -1036,7 +1038,7 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_other_transformation) { " OPERATIONACCURACY[0.0],\n" " USAGE[\n" " SCOPE[\"Change of prime meridian.\"],\n" - " AREA[\"Europe - Czechoslovakia\"],\n" + " AREA[\"Czechia; Slovakia.\"],\n" " BBOX[47.73,12.09,51.06,22.56]],\n" " ID[\"EPSG\",1884]]"; -- cgit v1.2.3 From ecf9cf0d975b3eb7630a314e8b32dd59658c3e2a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Oct 2020 17:31:13 +0200 Subject: getCRSInfoList(): make it use area description --- test/unit/test_c_api.cpp | 2 +- test/unit/test_factory.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index c20aec39..8e1dddfa 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3397,7 +3397,7 @@ TEST_F(CApi, proj_get_crs_info_list_from_database) { EXPECT_EQ(list[i]->south_lat_degree, -90.0); EXPECT_EQ(list[i]->east_lon_degree, 180.0); EXPECT_EQ(list[i]->north_lat_degree, 90.0); - EXPECT_EQ(std::string(list[i]->area_name), "World"); + EXPECT_EQ(std::string(list[i]->area_name), "World."); EXPECT_EQ(list[i]->projection_method_name, nullptr); } else if (code == "4978") { found4978 = true; diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 5ddc2387..37f546f1 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -3151,7 +3151,7 @@ TEST(factory, getCRSInfoList) { EXPECT_EQ(info.south_lat_degree, -90.0); EXPECT_EQ(info.east_lon_degree, 180.0); EXPECT_EQ(info.north_lat_degree, 90.0); - EXPECT_EQ(info.areaName, "World"); + EXPECT_EQ(info.areaName, "World."); EXPECT_TRUE(info.projectionMethodName.empty()); found4326 = true; } else if (info.code == "4296") { // Soudan - deprecated @@ -3180,9 +3180,10 @@ TEST(factory, getCRSInfoList) { EXPECT_EQ(info.south_lat_degree, 0.0); EXPECT_EQ(info.east_lon_degree, 6.0); EXPECT_EQ(info.north_lat_degree, 84.0); - EXPECT_EQ(info.areaName, "World - N hemisphere - 0\xC2\xB0" - "E to 6\xC2\xB0" - "E - by country"); + EXPECT_TRUE(info.areaName.find("Between 0\xC2\xB0" + "E and 6\xC2\xB0" + "E, northern hemisphere") == 0) + << info.areaName; EXPECT_EQ(info.projectionMethodName, "Transverse Mercator"); found32631 = true; } else if (info.code == "3855") { -- cgit v1.2.3 From ff9a386c72afb277aa79b86c7efb54e9843e810a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 6 Oct 2020 17:08:29 +0200 Subject: Database: import datum ensemble accuracy and members (but do not use them) --- test/unit/test_factory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 37f546f1..1d070a43 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -1456,7 +1456,7 @@ class FactoryWithTmpDatabase : public ::testing::Test { ASSERT_TRUE( execute("INSERT INTO geodetic_datum " "VALUES('EPSG','6326','World Geodetic System 1984',''," - "'EPSG','7030','EPSG','8901',NULL,NULL,0);")) + "'EPSG','7030','EPSG','8901',NULL,NULL,NULL,0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," "'geodetic_datum_6326_usage','geodetic_datum'," @@ -1464,7 +1464,7 @@ class FactoryWithTmpDatabase : public ::testing::Test { << last_error(); ASSERT_TRUE( execute("INSERT INTO vertical_datum VALUES('EPSG','1027','EGM2008 " - "geoid',NULL,NULL,0);")) + "geoid',NULL,NULL,NULL,0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," "'vertical_datum_1027_usage','vertical_datum'," @@ -1663,7 +1663,8 @@ class FactoryWithTmpDatabase : public ::testing::Test { "VALUES('FOO','" + val + "','" + val + "',''," - "'EPSG','7030','EPSG','8901',NULL,NULL,0);")) + "'EPSG','7030','EPSG','8901'," + "NULL,NULL,NULL,0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO usage VALUES('FOO'," "'geodetic_datum_" + -- cgit v1.2.3 From b5369cc79eccc625419d37bb97a5361731fd8f0f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 6 Oct 2020 22:15:31 +0200 Subject: Add a AuthorityFactory::createDatumEnsemble() method, and make it inherit from ObjectUsage as mandated by ISO 19111:2019 --- test/unit/test_factory.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'test') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 1d070a43..6b87fba6 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -316,6 +316,48 @@ TEST(factory, AuthorityFactory_createDatum) { // --------------------------------------------------------------------------- +TEST(factory, AuthorityFactory_createDatumEnsembleGeodetic) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + EXPECT_THROW(factory->createDatumEnsemble("-1"), + NoSuchAuthorityCodeException); + EXPECT_THROW(factory->createDatumEnsemble("6326", "vertical_datum"), + NoSuchAuthorityCodeException); + auto ensemble = factory->createDatumEnsemble("6326"); + EXPECT_EQ(ensemble->nameStr(), "World Geodetic System 1984 ensemble"); + ASSERT_EQ(ensemble->identifiers().size(), 1U); + EXPECT_EQ(ensemble->identifiers()[0]->code(), "6326"); + EXPECT_EQ(*(ensemble->identifiers()[0]->codeSpace()), "EPSG"); + EXPECT_EQ(ensemble->datums().size(), 6U); + EXPECT_EQ(ensemble->positionalAccuracy()->value(), "2.0"); + ASSERT_TRUE(!ensemble->domains().empty()); + auto domain = ensemble->domains()[0]; + auto extent = domain->domainOfValidity(); + ASSERT_TRUE(extent != nullptr); + EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("1262").get())); +} + +// --------------------------------------------------------------------------- + +TEST(factory, AuthorityFactory_createDatumEnsembleVertical) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + EXPECT_THROW(factory->createDatumEnsemble("1288", "geodetic_datum"), + NoSuchAuthorityCodeException); + auto ensemble = factory->createDatumEnsemble("1288"); + EXPECT_EQ(ensemble->nameStr(), "British Isles height ensemble"); + ASSERT_EQ(ensemble->identifiers().size(), 1U); + EXPECT_EQ(ensemble->identifiers()[0]->code(), "1288"); + EXPECT_EQ(*(ensemble->identifiers()[0]->codeSpace()), "EPSG"); + EXPECT_EQ(ensemble->datums().size(), 9U); + EXPECT_EQ(ensemble->positionalAccuracy()->value(), "0.4"); + ASSERT_TRUE(!ensemble->domains().empty()); + auto domain = ensemble->domains()[0]; + auto extent = domain->domainOfValidity(); + ASSERT_TRUE(extent != nullptr); + EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("4606").get())); +} + +// --------------------------------------------------------------------------- + TEST(factory, AuthorityFactory_createCoordinateSystem_ellipsoidal_2_axis) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); EXPECT_THROW(factory->createCoordinateSystem("-1"), -- cgit v1.2.3 From 9dc3bf503b0455526a4d180930f8414621ea6187 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 6 Oct 2020 23:48:46 +0200 Subject: Add DatumEnsemble::asDatum() and use it in exportToWkt() to allow exporting DatumEnsemble to WKT < 2019. --- test/unit/test_datum.cpp | 11 +++++++++-- test/unit/test_factory.cpp | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/unit/test_datum.cpp b/test/unit/test_datum.cpp index adf0ae4b..26098d5c 100644 --- a/test/unit/test_datum.cpp +++ b/test/unit/test_datum.cpp @@ -409,8 +409,7 @@ TEST(datum, datum_ensemble) { PositionalAccuracy::create("100")); EXPECT_EQ(ensemble->datums().size(), 2U); EXPECT_EQ(ensemble->positionalAccuracy()->value(), "100"); - EXPECT_THROW(ensemble->exportToWKT(WKTFormatter::create().get()), - FormattingException); + EXPECT_EQ( ensemble->exportToWKT( WKTFormatter::create(WKTFormatter::Convention::WKT2_2019).get()), @@ -422,6 +421,14 @@ TEST(datum, datum_ensemble) { " LENGTHUNIT[\"metre\",1],\n" " ID[\"EPSG\",7030]],\n" " ENSEMBLEACCURACY[100]]"); + + EXPECT_EQ( + ensemble->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT2_2015).get()), + "DATUM[\"test\",\n" + " ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n" + " LENGTHUNIT[\"metre\",1],\n" + " ID[\"EPSG\",7030]]]"); } // --------------------------------------------------------------------------- diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 6b87fba6..b17a3077 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -334,6 +334,24 @@ TEST(factory, AuthorityFactory_createDatumEnsembleGeodetic) { auto extent = domain->domainOfValidity(); ASSERT_TRUE(extent != nullptr); EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("1262").get())); + + { + // Without using db + auto datum = ensemble->asDatum(nullptr); + EXPECT_EQ(datum->nameStr(), "World Geodetic System 1984"); + auto grf = dynamic_cast(datum.get()); + ASSERT_TRUE(grf != nullptr); + EXPECT_TRUE(grf->isEquivalentTo(factory->createDatum("6326").get())); + } + + { + // Using db + auto datum = ensemble->asDatum(DatabaseContext::create()); + EXPECT_EQ(datum->nameStr(), "World Geodetic System 1984"); + auto grf = dynamic_cast(datum.get()); + ASSERT_TRUE(grf != nullptr); + EXPECT_TRUE(grf->isEquivalentTo(factory->createDatum("6326").get())); + } } // --------------------------------------------------------------------------- @@ -354,6 +372,22 @@ TEST(factory, AuthorityFactory_createDatumEnsembleVertical) { auto extent = domain->domainOfValidity(); ASSERT_TRUE(extent != nullptr); EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("4606").get())); + + { + // Without using db + auto datum = ensemble->asDatum(nullptr); + auto vrf = dynamic_cast(datum.get()); + ASSERT_TRUE(vrf != nullptr); + EXPECT_TRUE(vrf->isEquivalentTo(factory->createDatum("1288").get())); + } + + { + // Using db + auto datum = ensemble->asDatum(DatabaseContext::create()); + auto vrf = dynamic_cast(datum.get()); + ASSERT_TRUE(vrf != nullptr); + EXPECT_TRUE(vrf->isEquivalentTo(factory->createDatum("1288").get())); + } } // --------------------------------------------------------------------------- -- cgit v1.2.3 From 53672bdf7074e3737f6e6a53ee7373dcbccd6ea4 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 7 Oct 2020 23:58:36 +0200 Subject: Make CRS identification work with CRS with DatumEnsemble --- test/unit/test_crs.cpp | 183 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) (limited to 'test') diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index e8758932..ec30580a 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -1680,6 +1680,90 @@ TEST(crs, geodeticcrs_identify_db) { EXPECT_EQ(res.front().first->identifiers()[0]->code(), "7844"); EXPECT_EQ(res.front().second, 100); } + { + // Identify with DatumEnsemble + auto wkt = + "GEOGCRS[\"WGS 84\"," + " ENSEMBLE[\"World Geodetic System 1984 ensemble\"," + " MEMBER[\"World Geodetic System 1984 (Transit)\"," + " ID[\"EPSG\",1166]]," + " MEMBER[\"World Geodetic System 1984 (G730)\"," + " ID[\"EPSG\",1152]]," + " MEMBER[\"World Geodetic System 1984 (G873)\"," + " ID[\"EPSG\",1153]]," + " MEMBER[\"World Geodetic System 1984 (G1150)\"," + " ID[\"EPSG\",1154]]," + " MEMBER[\"World Geodetic System 1984 (G1674)\"," + " ID[\"EPSG\",1155]]," + " MEMBER[\"World Geodetic System 1984 (G1762)\"," + " ID[\"EPSG\",1156]]," + " ELLIPSOID[\"WGS 84\",6378137,298.257223563," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]," + " ID[\"EPSG\",7030]]," + " ENSEMBLEACCURACY[2]]," + " PRIMEM[\"Greenwich\",0," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]," + " ID[\"EPSG\",8901]]," + " CS[ellipsoidal,2," + " ID[\"EPSG\",6422]]," + " AXIS[\"Geodetic latitude (Lat)\",north," + " ORDER[1]]," + " AXIS[\"Geodetic longitude (Lon)\",east," + " ORDER[2]]," + " ANGLEUNIT[\"degree (supplier to define representation)\"," + "0.0174532925199433,ID[\"EPSG\",9122]]]"; + auto obj = WKTParser().createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + + auto allFactory = AuthorityFactory::create(dbContext, std::string()); + auto res = crs->identify(allFactory); + ASSERT_EQ(res.size(), 1U); + EXPECT_EQ(res.front().first->getEPSGCode(), 4326); + EXPECT_EQ(res.front().second, 100.0); + } + { + // Identify with DatumEnsemble and unknown CRS name + auto wkt = + "GEOGCRS[\"unknown\"," + " ENSEMBLE[\"World Geodetic System 1984 ensemble\"," + " MEMBER[\"World Geodetic System 1984 (Transit)\"," + " ID[\"EPSG\",1166]]," + " MEMBER[\"World Geodetic System 1984 (G730)\"," + " ID[\"EPSG\",1152]]," + " MEMBER[\"World Geodetic System 1984 (G873)\"," + " ID[\"EPSG\",1153]]," + " MEMBER[\"World Geodetic System 1984 (G1150)\"," + " ID[\"EPSG\",1154]]," + " MEMBER[\"World Geodetic System 1984 (G1674)\"," + " ID[\"EPSG\",1155]]," + " MEMBER[\"World Geodetic System 1984 (G1762)\"," + " ID[\"EPSG\",1156]]," + " ELLIPSOID[\"WGS 84\",6378137,298.257223563," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]," + " ID[\"EPSG\",7030]]," + " ENSEMBLEACCURACY[2]]," + " PRIMEM[\"Greenwich\",0," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]," + " ID[\"EPSG\",8901]]," + " CS[ellipsoidal,2," + " ID[\"EPSG\",6422]]," + " AXIS[\"Geodetic latitude (Lat)\",north," + " ORDER[1]]," + " AXIS[\"Geodetic longitude (Lon)\",east," + " ORDER[2]]," + " ANGLEUNIT[\"degree (supplier to define representation)\"," + "0.0174532925199433,ID[\"EPSG\",9122]]]"; + auto obj = WKTParser().createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + + auto allFactory = AuthorityFactory::create(dbContext, std::string()); + auto res = crs->identify(allFactory); + ASSERT_EQ(res.size(), 1U); + EXPECT_EQ(res.front().first->getEPSGCode(), 4326); + EXPECT_EQ(res.front().second, 70.0); + } } // --------------------------------------------------------------------------- @@ -2694,6 +2778,105 @@ TEST(crs, projectedCRS_identify_db) { EXPECT_EQ(res.front().first->getEPSGCode(), 2154); EXPECT_EQ(res.front().second, 90); } + { + // Identify with DatumEnsemble + auto wkt = + "PROJCRS[\"WGS 84 / UTM zone 31N\"," + " BASEGEOGCRS[\"WGS 84\"," + " ENSEMBLE[\"World Geodetic System 1984 ensemble\"," + " MEMBER[\"World Geodetic System 1984 (Transit)\"," + " ID[\"EPSG\",1166]]," + " MEMBER[\"World Geodetic System 1984 (G730)\"," + " ID[\"EPSG\",1152]]," + " MEMBER[\"World Geodetic System 1984 (G873)\"," + " ID[\"EPSG\",1153]]," + " MEMBER[\"World Geodetic System 1984 (G1150)\"," + " ID[\"EPSG\",1154]]," + " MEMBER[\"World Geodetic System 1984 (G1674)\"," + " ID[\"EPSG\",1155]]," + " MEMBER[\"World Geodetic System 1984 (G1762)\"," + " ID[\"EPSG\",1156]]," + " ELLIPSOID[\"WGS 84\",6378137,298.257223563," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]," + " ENSEMBLEACCURACY[2]]]," + " CONVERSION[\"UTM zone 31N\"," + " METHOD[\"Transverse Mercator\"," + " ID[\"EPSG\",9807]]," + " PARAMETER[\"Latitude of natural origin\",0," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," + " PARAMETER[\"Longitude of natural origin\",3," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," + " PARAMETER[\"Scale factor at natural origin\",0.9996," + " SCALEUNIT[\"unity\",1,ID[\"EPSG\",9201]]]," + " PARAMETER[\"False easting\",500000," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]," + " PARAMETER[\"False northing\",0," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]]," + " CS[Cartesian,2]," + " AXIS[\"Easting (E)\",east," + " ORDER[1]]," + " AXIS[\"Northing (N)\",north," + " ORDER[2]]," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]"; + auto obj = WKTParser().createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + + auto allFactory = AuthorityFactory::create(dbContext, std::string()); + auto res = crs->identify(allFactory); + ASSERT_EQ(res.size(), 1U); + EXPECT_EQ(res.front().first->getEPSGCode(), 32631); + EXPECT_EQ(res.front().second, 100.0); + } + { + // Identify with DatumEnsemble and unknown CRS name + auto wkt = + "PROJCRS[\"unknown\"," + " BASEGEOGCRS[\"unknown\"," + " ENSEMBLE[\"World Geodetic System 1984 ensemble\"," + " MEMBER[\"World Geodetic System 1984 (Transit)\"," + " ID[\"EPSG\",1166]]," + " MEMBER[\"World Geodetic System 1984 (G730)\"," + " ID[\"EPSG\",1152]]," + " MEMBER[\"World Geodetic System 1984 (G873)\"," + " ID[\"EPSG\",1153]]," + " MEMBER[\"World Geodetic System 1984 (G1150)\"," + " ID[\"EPSG\",1154]]," + " MEMBER[\"World Geodetic System 1984 (G1674)\"," + " ID[\"EPSG\",1155]]," + " MEMBER[\"World Geodetic System 1984 (G1762)\"," + " ID[\"EPSG\",1156]]," + " ELLIPSOID[\"WGS 84\",6378137,298.257223563," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]," + " ENSEMBLEACCURACY[2]]]," + " CONVERSION[\"UTM zone 31N\"," + " METHOD[\"Transverse Mercator\"," + " ID[\"EPSG\",9807]]," + " PARAMETER[\"Latitude of natural origin\",0," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," + " PARAMETER[\"Longitude of natural origin\",3," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," + " PARAMETER[\"Scale factor at natural origin\",0.9996," + " SCALEUNIT[\"unity\",1,ID[\"EPSG\",9201]]]," + " PARAMETER[\"False easting\",500000," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]," + " PARAMETER[\"False northing\",0," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]]," + " CS[Cartesian,2]," + " AXIS[\"Easting (E)\",east," + " ORDER[1]]," + " AXIS[\"Northing (N)\",north," + " ORDER[2]]," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]"; + auto obj = WKTParser().createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + + auto res = crs->identify(factoryEPSG); + ASSERT_EQ(res.size(), 1U); + EXPECT_EQ(res.front().first->getEPSGCode(), 32631); + EXPECT_GE(res.front().second, 70.0); + } } // --------------------------------------------------------------------------- -- cgit v1.2.3 From 492c95ce77f4ebdab401c6fcc2d1dae5c6b5c401 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Oct 2020 00:51:00 +0200 Subject: Make createOperations() work with DatumEnsemble --- test/unit/test_operation.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'test') diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index c7c0a262..ce4b866b 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -4807,6 +4807,54 @@ TEST(operation, geogCRS_to_geogCRS_context_invalid_EPSG_ID) { // --------------------------------------------------------------------------- +TEST(operation, geogCRS_to_geogCRS_context_datum_ensemble) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0); + + auto dst_wkt = + "GEOGCRS[\"unknown\"," + " ENSEMBLE[\"World Geodetic System 1984 ensemble\"," + " MEMBER[\"World Geodetic System 1984 (Transit)\"," + " ID[\"EPSG\",1166]]," + " MEMBER[\"World Geodetic System 1984 (G730)\"," + " ID[\"EPSG\",1152]]," + " MEMBER[\"World Geodetic System 1984 (G873)\"," + " ID[\"EPSG\",1153]]," + " MEMBER[\"World Geodetic System 1984 (G1150)\"," + " ID[\"EPSG\",1154]]," + " MEMBER[\"World Geodetic System 1984 (G1674)\"," + " ID[\"EPSG\",1155]]," + " MEMBER[\"World Geodetic System 1984 (G1762)\"," + " ID[\"EPSG\",1156]]," + " ELLIPSOID[\"WGS 84\",6378137,298.257223563," + " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]," + " ID[\"EPSG\",7030]]," + " ENSEMBLEACCURACY[2]]," + " PRIMEM[\"Greenwich\",0," + " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]," + " ID[\"EPSG\",8901]]," + " CS[ellipsoidal,2," + " ID[\"EPSG\",6422]]," + " AXIS[\"Geodetic latitude (Lat)\",north," + " ORDER[1]]," + " AXIS[\"Geodetic longitude (Lon)\",east," + " ORDER[2]]," + " ANGLEUNIT[\"degree (supplier to define representation)\"," + "0.0174532925199433,ID[\"EPSG\",9122]]]"; + auto dstObj = WKTParser().createFromWKT(dst_wkt); + auto dstCRS = nn_dynamic_pointer_cast(dstObj); + ASSERT_TRUE(dstCRS != nullptr); + + auto list = CoordinateOperationFactory::create()->createOperations( + authFactory->createCoordinateReferenceSystem("4258"), // ETRS89 + NN_NO_CHECK(dstCRS), ctxt); + ASSERT_EQ(list.size(), 1U); + EXPECT_EQ(list[0]->nameStr(), "ETRS89 to WGS 84 (1)"); +} + +// --------------------------------------------------------------------------- + TEST(operation, vertCRS_to_geogCRS_context) { auto authFactory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); -- cgit v1.2.3 From f14782192083ab9ebb22bf94e3138722657dde9f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Oct 2020 15:48:08 +0200 Subject: Add C API to work with datum ensemble Add: - proj_crs_get_datum_ensemble() - proj_crs_get_datum_forced() - proj_datum_ensemble_get_member_count() - proj_datum_ensemble_get_accuracy() - proj_datum_ensemble_get_member() Make proj_create_geographic_crs_from_datum() and proj_create_geocentric_crs_from_datum() accept a datum ensemble. --- test/unit/test_c_api.cpp | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) (limited to 'test') diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 8e1dddfa..bd59e2bf 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -4917,4 +4917,102 @@ TEST_F(CApi, proj_is_equivalent_to_with_ctx) { PJ_COMP_EQUIVALENT)); } +// --------------------------------------------------------------------------- + +TEST_F(CApi, datum_ensemble) { + auto wkt = + "GEOGCRS[\"ETRS89\"," + " ENSEMBLE[\"European Terrestrial Reference System 1989 ensemble\"," + " MEMBER[\"European Terrestrial Reference Frame 1989\"]," + " MEMBER[\"European Terrestrial Reference Frame 1990\"]," + " MEMBER[\"European Terrestrial Reference Frame 1991\"]," + " MEMBER[\"European Terrestrial Reference Frame 1992\"]," + " MEMBER[\"European Terrestrial Reference Frame 1993\"]," + " MEMBER[\"European Terrestrial Reference Frame 1994\"]," + " MEMBER[\"European Terrestrial Reference Frame 1996\"]," + " MEMBER[\"European Terrestrial Reference Frame 1997\"]," + " MEMBER[\"European Terrestrial Reference Frame 2000\"]," + " MEMBER[\"European Terrestrial Reference Frame 2005\"]," + " MEMBER[\"European Terrestrial Reference Frame 2014\"]," + " ELLIPSOID[\"GRS 1980\",6378137,298.257222101," + " LENGTHUNIT[\"metre\",1]]," + " ENSEMBLEACCURACY[0.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]]]"; + auto from_wkt = + proj_create_from_wkt(m_ctxt, wkt, nullptr, nullptr, nullptr); + ObjectKeeper keeper_from_wkt(from_wkt); + EXPECT_NE(from_wkt, nullptr); + + auto datum = proj_crs_get_datum(m_ctxt, from_wkt); + ObjectKeeper keeper_datum(datum); + ASSERT_EQ(datum, nullptr); + + auto datum_ensemble = proj_crs_get_datum_ensemble(m_ctxt, from_wkt); + ObjectKeeper keeper_datum_ensemble(datum_ensemble); + ASSERT_NE(datum_ensemble, nullptr); + + ASSERT_EQ(proj_datum_ensemble_get_member_count(m_ctxt, datum_ensemble), 11); + ASSERT_EQ(proj_datum_ensemble_get_member(m_ctxt, datum_ensemble, -1), + nullptr); + ASSERT_EQ(proj_datum_ensemble_get_member(m_ctxt, datum_ensemble, 11), + nullptr); + + { + auto member = proj_datum_ensemble_get_member(m_ctxt, datum_ensemble, 0); + ObjectKeeper keeper_member(member); + ASSERT_NE(member, nullptr); + + EXPECT_EQ(proj_get_name(member), + std::string("European Terrestrial Reference Frame 1989")); + } + + { + auto member = + proj_datum_ensemble_get_member(m_ctxt, datum_ensemble, 10); + ObjectKeeper keeper_member(member); + ASSERT_NE(member, nullptr); + + EXPECT_EQ(proj_get_name(member), + std::string("European Terrestrial Reference Frame 2014")); + } + + ASSERT_EQ(proj_datum_ensemble_get_accuracy(m_ctxt, datum_ensemble), 0.1); + + auto datum_forced = proj_crs_get_datum_forced(m_ctxt, from_wkt); + ObjectKeeper keeper_datum_forced(datum_forced); + ASSERT_NE(datum_forced, nullptr); + + EXPECT_EQ(proj_get_name(datum_forced), + std::string("European Terrestrial Reference System 1989")); + + auto cs = proj_crs_get_coordinate_system(m_ctxt, from_wkt); + ObjectKeeper keeper_cs(cs); + EXPECT_NE(cs, nullptr); + + { + auto built_crs = proj_create_geographic_crs_from_datum( + m_ctxt, proj_get_name(from_wkt), datum_ensemble, cs); + ObjectKeeper keeper_built_crs(built_crs); + EXPECT_NE(built_crs, nullptr); + + EXPECT_TRUE(proj_is_equivalent_to_with_ctx(m_ctxt, built_crs, from_wkt, + PJ_COMP_EQUIVALENT)); + } + + { + auto built_crs = proj_create_geocentric_crs_from_datum( + m_ctxt, proj_get_name(from_wkt), datum_ensemble, "metre", 1.0); + ObjectKeeper keeper_built_crs(built_crs); + EXPECT_NE(built_crs, nullptr); + } +} + } // namespace -- cgit v1.2.3 From ad80dc88a70032e1d96812b574b2d4d22e223394 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 11 Oct 2020 19:50:09 +0200 Subject: Database: add a frame_reference_epoch column in vertical_datum to be able to handle dynamic vertical datums, and instanciate them properly from database --- test/cli/testprojinfo_out.dist | 2 ++ test/unit/test_factory.cpp | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 4ba7304e..42000716 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -912,6 +912,8 @@ WKT2:2019 string: COORDINATEOPERATION["Inverse of SWEREF99 to RH2000 height", SOURCECRS[ VERTCRS["RH2000 height", + DYNAMIC[ + FRAMEEPOCH[2000]], VDATUM["Rikets hojdsystem 2000"], CS[vertical,1], AXIS["gravity-related height (H)",up, diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index b17a3077..366e3d9b 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -301,6 +301,18 @@ TEST(factory, AuthorityFactory_createVerticalDatum) { auto extent = domain->domainOfValidity(); ASSERT_TRUE(extent != nullptr); EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("1262").get())); + EXPECT_TRUE(vrf->publicationDate().has_value()); + EXPECT_EQ(vrf->publicationDate()->toString(), "2008-01-01"); +} + +// --------------------------------------------------------------------------- + +TEST(factory, AuthorityFactory_createDynamicVerticalDatum) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto grf = factory->createVerticalDatum("1096"); // Norway Normal Null 2000 + auto dvrf = nn_dynamic_pointer_cast(grf); + ASSERT_TRUE(dvrf != nullptr); + EXPECT_EQ(dvrf->frameReferenceEpoch().value(), 2000.0); } // --------------------------------------------------------------------------- @@ -1540,7 +1552,7 @@ class FactoryWithTmpDatabase : public ::testing::Test { << last_error(); ASSERT_TRUE( execute("INSERT INTO vertical_datum VALUES('EPSG','1027','EGM2008 " - "geoid',NULL,NULL,NULL,0);")) + "geoid',NULL,NULL,NULL,NULL,0);")) << last_error(); ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG'," "'vertical_datum_1027_usage','vertical_datum'," -- cgit v1.2.3 From d1a0d95da549f7d32bcd8be408afe1fca62a6fb2 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 11 Oct 2020 20:01:29 +0200 Subject: Database query: add AuthorityFactory::ObjectType::DYNAMIC_GEODETIC_REFERENCE_FRAME and DYNAMIC_VERTICAL_REFERENCE_FRAME, and make corresponding C API work --- test/unit/test_c_api.cpp | 26 ++++++++++++++++++++++++++ test/unit/test_factory.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) (limited to 'test') diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index bd59e2bf..c7053291 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -844,6 +844,24 @@ TEST_F(CApi, proj_create_from_database) { ObjectKeeper keeper(datum); EXPECT_EQ(proj_get_type(datum), PJ_TYPE_GEODETIC_REFERENCE_FRAME); } + { + // International Terrestrial Reference Frame 2008 + auto datum = proj_create_from_database( + m_ctxt, "EPSG", "1061", PJ_CATEGORY_DATUM, false, nullptr); + ASSERT_NE(datum, nullptr); + ObjectKeeper keeper(datum); + EXPECT_EQ(proj_get_type(datum), + PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME); + } + { + // Norway Normal Null 2000 + auto datum = proj_create_from_database( + m_ctxt, "EPSG", "1096", PJ_CATEGORY_DATUM, false, nullptr); + ASSERT_NE(datum, nullptr); + ObjectKeeper keeper(datum); + EXPECT_EQ(proj_get_type(datum), + PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME); + } { auto op = proj_create_from_database(m_ctxt, "EPSG", "16031", PJ_CATEGORY_COORDINATE_OPERATION, @@ -1197,6 +1215,14 @@ TEST_F(CApi, proj_get_codes_from_database) { } else { ASSERT_NE(list, nullptr) << type; ASSERT_NE(list[0], nullptr) << type; + if (type == PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME || + type == PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME) { + auto obj = proj_create_from_database( + m_ctxt, "EPSG", list[0], PJ_CATEGORY_DATUM, false, nullptr); + ASSERT_NE(obj, nullptr); + ObjectKeeper keeper(obj); + EXPECT_EQ(proj_get_type(obj), type) << type << " " << list[0]; + } } } } diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 366e3d9b..2a9d2bd2 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -1337,11 +1337,29 @@ TEST(factory, AuthorityFactory_getAuthorityCodes) { ASSERT_TRUE(!setGeodeticDatum.empty()); factory->createGeodeticDatum(*(setGeodeticDatum.begin())); + auto setDynamicGeodeticDatum = factory->getAuthorityCodes( + AuthorityFactory::ObjectType::DYNAMIC_GEODETIC_REFERENCE_FRAME); + ASSERT_TRUE(!setDynamicGeodeticDatum.empty()); + auto dgrf = + factory->createGeodeticDatum(*(setDynamicGeodeticDatum.begin())); + EXPECT_TRUE(dynamic_cast(dgrf.get()) != + nullptr); + EXPECT_LT(setDynamicGeodeticDatum.size(), setGeodeticDatum.size()); + auto setVerticalDatum = factory->getAuthorityCodes( AuthorityFactory::ObjectType::VERTICAL_REFERENCE_FRAME); ASSERT_TRUE(!setVerticalDatum.empty()); factory->createVerticalDatum(*(setVerticalDatum.begin())); + auto setDynamicVerticalDatum = factory->getAuthorityCodes( + AuthorityFactory::ObjectType::DYNAMIC_VERTICAL_REFERENCE_FRAME); + ASSERT_TRUE(!setDynamicVerticalDatum.empty()); + auto dvrf = + factory->createVerticalDatum(*(setDynamicVerticalDatum.begin())); + EXPECT_TRUE(dynamic_cast(dvrf.get()) != + nullptr); + EXPECT_LT(setDynamicVerticalDatum.size(), setVerticalDatum.size()); + std::set setMerged; for (const auto &v : setGeodeticDatum) { setMerged.insert(v); @@ -3128,12 +3146,34 @@ TEST(factory, createObjectsFromName) { .size(), 1U); + // Dynamic Geodetic datum + EXPECT_EQ(factoryEPSG + ->createObjectsFromName( + "International Terrestrial Reference Frame 2008", + {AuthorityFactory::ObjectType:: + DYNAMIC_GEODETIC_REFERENCE_FRAME}, + false, 2) + .size(), + 1U); + + // Dynamic Vertical datum + EXPECT_EQ( + factoryEPSG + ->createObjectsFromName("Norway Normal Null 2000", + {AuthorityFactory::ObjectType:: + DYNAMIC_VERTICAL_REFERENCE_FRAME}, + false, 2) + .size(), + 1U); + const auto types = std::vector{ AuthorityFactory::ObjectType::PRIME_MERIDIAN, AuthorityFactory::ObjectType::ELLIPSOID, AuthorityFactory::ObjectType::DATUM, AuthorityFactory::ObjectType::GEODETIC_REFERENCE_FRAME, + AuthorityFactory::ObjectType::DYNAMIC_GEODETIC_REFERENCE_FRAME, AuthorityFactory::ObjectType::VERTICAL_REFERENCE_FRAME, + AuthorityFactory::ObjectType::DYNAMIC_VERTICAL_REFERENCE_FRAME, AuthorityFactory::ObjectType::CRS, AuthorityFactory::ObjectType::GEODETIC_CRS, AuthorityFactory::ObjectType::GEOCENTRIC_CRS, -- cgit v1.2.3 From 686713479eb0b39feb5369b82647f96edf809b6c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 11 Oct 2020 20:13:42 +0200 Subject: C API: add proj_dynamic_datum_get_frame_reference_epoch() --- test/unit/test_c_api.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index c7053291..c0db3880 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -852,6 +852,8 @@ TEST_F(CApi, proj_create_from_database) { ObjectKeeper keeper(datum); EXPECT_EQ(proj_get_type(datum), PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME); + EXPECT_EQ(proj_dynamic_datum_get_frame_reference_epoch(m_ctxt, datum), + 2005.0); } { // Norway Normal Null 2000 @@ -861,6 +863,8 @@ TEST_F(CApi, proj_create_from_database) { ObjectKeeper keeper(datum); EXPECT_EQ(proj_get_type(datum), PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME); + EXPECT_EQ(proj_dynamic_datum_get_frame_reference_epoch(m_ctxt, datum), + 2000.0); } { auto op = proj_create_from_database(m_ctxt, "EPSG", "16031", -- cgit v1.2.3