diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-12-01 00:16:15 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-12-03 14:27:35 +0100 |
| commit | 5a7ff4380e9526aca0287e45b27a8b37664e9708 (patch) | |
| tree | 446c438497bdd02a6df80cb98130462af77787cc | |
| parent | a0de56228be06427c7870cbc1923b11dad11856e (diff) | |
| download | PROJ-5a7ff4380e9526aca0287e45b27a8b37664e9708.tar.gz PROJ-5a7ff4380e9526aca0287e45b27a8b37664e9708.zip | |
Database: register AUSGeoid09 and AUSGeoid2020
Related to https://github.com/OSGeo/proj-datumgrid/pull/66
Tune operation search so that it can work with Geog2D <--> VertCS for commandline
niceness
| -rw-r--r-- | data/sql/grid_alternatives.sql | 30 | ||||
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 37 | ||||
| -rwxr-xr-x | test/cli/testprojinfo | 8 | ||||
| -rw-r--r-- | test/cli/testprojinfo_out.dist | 20 |
4 files changed, 92 insertions, 3 deletions
diff --git a/data/sql/grid_alternatives.sql b/data/sql/grid_alternatives.sql index 647f14e6..d240a3d8 100644 --- a/data/sql/grid_alternatives.sql +++ b/data/sql/grid_alternatives.sql @@ -1046,6 +1046,36 @@ INSERT INTO grid_alternatives(original_grid_name, 'proj-datumgrid-oceania', NULL, NULL, NULL, NULL); +INSERT INTO grid_alternatives(original_grid_name, + proj_grid_name, + proj_grid_format, + proj_method, + inverse_direction, + package_name, + url, direct_download, open_license, directory) + VALUES ('AUSGeoid09_GDA94_V1.01_DOV_windows.gsb', -- source file contains undulation in first band, and deflection in 2nd and 3d band + 'AUSGeoid09_V1.01.gtx', + 'GTX', + 'vgridshift', + 1, + 'proj-datumgrid-oceania', + NULL, NULL, NULL, NULL); + +INSERT INTO grid_alternatives(original_grid_name, + proj_grid_name, + proj_grid_format, + proj_method, + inverse_direction, + package_name, + url, direct_download, open_license, directory) + VALUES ('AUSGeoid2020_windows_binary.gsb', -- source file contains undulation in first band, and deflection in 2nd and 3d band + 'AUSGeoid2020_20180201.gtx', + 'GTX', + 'vgridshift', + 1, + 'proj-datumgrid-oceania', + NULL, NULL, NULL, NULL); + -- Netherlands / RDNAP (non-free grids) INSERT INTO grid_alternatives(original_grid_name, diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index c295aff2..1e806e31 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -12923,9 +12923,40 @@ bool CoordinateOperationFactory::Private::createOperationsFromDatabase( bool sameGeodeticDatum = false; if (vertSrc || vertDst) { - createOperationsFromDatabaseWithVertCRS(sourceCRS, targetCRS, context, - geogSrc, geogDst, vertSrc, - vertDst, res); + if (res.empty()) { + if (geogSrc && + geogSrc->coordinateSystem()->axisList().size() == 2 && + vertDst) { + auto dbContext = + context.context->getAuthorityFactory()->databaseContext(); + auto resTmp = findOpsInRegistryDirect( + sourceCRS->promoteTo3D(std::string(), dbContext), targetCRS, + context, resFindDirectNonEmptyBeforeFiltering); + for (auto &op : resTmp) { + auto newOp = op->shallowClone(); + setCRSs(newOp.get(), sourceCRS, targetCRS); + res.emplace_back(newOp); + } + } else if (geogDst && + geogDst->coordinateSystem()->axisList().size() == 2 && + vertSrc) { + auto dbContext = + context.context->getAuthorityFactory()->databaseContext(); + auto resTmp = findOpsInRegistryDirect( + sourceCRS, targetCRS->promoteTo3D(std::string(), dbContext), + context, resFindDirectNonEmptyBeforeFiltering); + for (auto &op : resTmp) { + auto newOp = op->shallowClone(); + setCRSs(newOp.get(), sourceCRS, targetCRS); + res.emplace_back(newOp); + } + } + } + if (res.empty()) { + createOperationsFromDatabaseWithVertCRS(sourceCRS, targetCRS, + context, geogSrc, geogDst, + vertSrc, vertDst, res); + } } else if (geodSrc && geodDst) { const auto &srcDatum = geodSrc->datum(); diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo index 9d0ce52d..4ce5e90c 100755 --- a/test/cli/testprojinfo +++ b/test/cli/testprojinfo @@ -147,6 +147,14 @@ echo 'Testing -s EPSG:31467 -t ETRS89 --spatial-test intersects --grid-check non $EXE -s EPSG:31467 -t ETRS89 --spatial-test intersects --grid-check none --bbox 8,48,9,49 --summary >>${OUT} 2>&1 echo "" >>${OUT} +echo 'Testing -s "GDA94" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects' >> ${OUT} +$EXE -s "GDA94" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects >>${OUT} 2>&1 +echo "" >>${OUT} + +echo 'Testing -s "GDA2020" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects' >> ${OUT} +$EXE -s "GDA2020" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects >>${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 8b17c0e7..25b29a79 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -1078,3 +1078,23 @@ unknown id, Inverse of 3-degree Gauss-Kruger zone 3 + DHDN to ETRS89 (8), 0.9 m, 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 +Testing -s "GDA94" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects +Candidate operations found: 1 +------------------------------------- +Operation n°1: + +DERIVED_FROM(EPSG):5656, GDA94 to AHD height (49), 0.03 m, Australia - mainland + +PROJ string: ++proj=pipeline +step +inv +proj=vgridshift +grids=AUSGeoid09_V1.01.gtx +multiplier=1 + +Testing -s "GDA2020" -t "AHD height" --grid-check none -o PROJ --spatial-test intersects +Candidate operations found: 1 +------------------------------------- +Operation n°1: + +DERIVED_FROM(EPSG):8451, GDA2020 to AHD height (1), 0.03 m, Australia Christmas and Cocos - onshore + +PROJ string: ++proj=pipeline +step +inv +proj=vgridshift +grids=AUSGeoid2020_20180201.gtx +multiplier=1 + |
