diff options
Diffstat (limited to 'test')
| -rwxr-xr-x | test/cli/testprojinfo | 25 | ||||
| -rw-r--r-- | test/cli/testprojinfo_out.dist | 47 | ||||
| -rw-r--r-- | test/unit/test_factory.cpp | 22 |
3 files changed, 94 insertions, 0 deletions
diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo index ad62d1da..90829fdd 100755 --- a/test/cli/testprojinfo +++ b/test/cli/testprojinfo @@ -49,6 +49,31 @@ echo "Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test inters $EXE -s NAD27 -t NAD83 --grid-check none --spatial-test intersects >>${OUT} echo "" >>${OUT} +echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary" >> ${OUT} +$EXE -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary >>${OUT} +echo "" >>${OUT} + +echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary" >> ${OUT} +$EXE -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary >>${OUT} +echo "" >>${OUT} + +echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area 'Denmark - onshore' --summary" >> ${OUT} +$EXE -s EPSG:4230 -t EPSG:4258 --area 'Denmark - onshore' --summary >>${OUT} +echo "" >>${OUT} + +# several match +echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area 'Denmark -' --summary" >> ${OUT} +$EXE -s EPSG:4230 -t EPSG:4258 --area 'Denmark -' --summary >>${OUT} 2>&1 +echo "" >>${OUT} + +echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area no_match --summary" >> ${OUT} +$EXE -s EPSG:4230 -t EPSG:4258 --area no_match --summary >>${OUT} 2>&1 +echo "" >>${OUT} + +echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area WRONG:CODE --summary" >> ${OUT} +$EXE -s EPSG:4230 -t EPSG:4258 --area WRONG:CODE --summary >>${OUT} 2>&1 +echo "" >>${OUT} + # do 'diff' with distribution results echo "diff ${OUT} with testprojinfo_out.dist" diff -u ${OUT} ${TEST_CLI_DIR}/testprojinfo_out.dist diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index fea5a299..f3d4854a 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -83,6 +83,8 @@ GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.25722 Testing projinfo -s EPSG:4326 -t EPSG:32631 +EPSG:16031, UTM zone 31N, 0 m, World - N hemisphere - 0°E to 6°E + 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 @@ -122,6 +124,8 @@ Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects ------------------------------------- Operation n°1: +DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 1.0 m, Canada + PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=ntv1_can.dat +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -166,6 +170,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (3)", ------------------------------------- Operation n°2: +DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - NAD27 + PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=ntv2_0.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -210,6 +216,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (4)", ------------------------------------- Operation n°3: +DERIVED_FROM(EPSG):1241, NAD27 to NAD83 (1), 0.15 m, USA - CONUS 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=conus +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -253,6 +261,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (1)", ------------------------------------- Operation n°4: +DERIVED_FROM(EPSG):1243, NAD27 to NAD83 (2), 0.5 m, 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=alaska +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -296,6 +306,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)", ------------------------------------- Operation n°5: +ESRI:108003, NAD_1927_To_NAD_1983_PR_VI, 0.05 m, Caribbean - Puerto Rico and Virgin Islands - onshore + PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=prvi +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -340,6 +352,8 @@ COORDINATEOPERATION["NAD_1927_To_NAD_1983_PR_VI", ------------------------------------- Operation n°6: +unknown id, Null geographic offset from NAD27 to NAD83, unknown accuracy, World + PROJ string: @@ -393,6 +407,8 @@ COORDINATEOPERATION["Null geographic offset from NAD27 to NAD83", ------------------------------------- Operation n°7: +EPSG:1462, NAD27 to NAD83 (5), 1.0 m, Canada - Quebec + PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GS2783v1.QUE +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -437,6 +453,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (5)", ------------------------------------- Operation n°8: +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=QUE27-83.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 @@ -478,3 +496,32 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)", BBOX[44.99,-79.85,62.62,-57.1], ID["EPSG",1573]] +Testing projinfo -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary +Candidate operations found: 1 +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 +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 +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 + +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 + diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 7cdb0b40..c30111ce 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -2746,4 +2746,26 @@ TEST(factory, getMetadata) { EXPECT_EQ(std::string(IGNF_VERSION), "3.0.2"); } +// --------------------------------------------------------------------------- + +TEST(factory, listAreaOfUseFromName) { + auto ctxt = DatabaseContext::create(); + auto factory = AuthorityFactory::create(ctxt, std::string()); + auto factoryEPSG = AuthorityFactory::create(ctxt, "EPSG"); + { + auto res = factory->listAreaOfUseFromName("Denmark - onshore", false); + ASSERT_EQ(res.size(), 1); + EXPECT_EQ(res.front().first, "EPSG"); + EXPECT_EQ(res.front().second, "3237"); + } + { + auto res = factory->listAreaOfUseFromName("Denmark", true); + EXPECT_GT(res.size(), 1U); + } + { + auto res = factory->listAreaOfUseFromName("no where land", false); + ASSERT_EQ(res.size(), 0); + } +} + } // namespace |
