diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-11-03 11:09:14 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-11-03 11:38:39 +0100 |
| commit | cff22050faa67017eb4c5b44cb383b265c07d156 (patch) | |
| tree | 662617772e34de80ca63270dedd20f7978fa8169 /src/iso19111/io.cpp | |
| parent | ff69c7e4535e869d0d9c6831c50d2f0fd2d288ca (diff) | |
| download | PROJ-cff22050faa67017eb4c5b44cb383b265c07d156.tar.gz PROJ-cff22050faa67017eb4c5b44cb383b265c07d156.zip | |
Import from WKT of VERT_CS: remove outdated EXTENSION.PROJ4_GRIDS for NAVD88
Diffstat (limited to 'src/iso19111/io.cpp')
| -rw-r--r-- | src/iso19111/io.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index d4e6132f..aab1db4f 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -3900,20 +3900,30 @@ CRSNNPtr WKTParser::Private::buildVerticalCRS(const WKTNodeNNPtr &node) { const auto &extensionChildren = extensionNode->GP()->children(); if (extensionChildren.size() == 2) { if (ci_equal(stripQuotes(extensionChildren[0]), "PROJ4_GRIDS")) { - std::string transformationName(crs->nameStr()); - if (!ends_with(transformationName, " height")) { - transformationName += " height"; + const auto gridName(stripQuotes(extensionChildren[1])); + // This is the expansion of EPSG:5703 by old GDAL versions. + // See + // https://trac.osgeo.org/metacrs/changeset?reponame=&new=2281%40geotiff%2Ftrunk%2Flibgeotiff%2Fcsv%2Fvertcs.override.csv&old=1893%40geotiff%2Ftrunk%2Flibgeotiff%2Fcsv%2Fvertcs.override.csv + // It is unlikely that the user really explictly wants this. + if (gridName != "g2003conus.gtx,g2003alaska.gtx," + "g2003h01.gtx,g2003p01.gtx" && + gridName != "g2012a_conus.gtx,g2012a_alaska.gtx," + "g2012a_guam.gtx,g2012a_hawaii.gtx," + "g2012a_puertorico.gtx,g2012a_samoa.gtx") { + std::string transformationName(crs->nameStr()); + if (!ends_with(transformationName, " height")) { + transformationName += " height"; + } + transformationName += " to WGS84 ellipsoidal height"; + auto transformation = Transformation:: + createGravityRelatedHeightToGeographic3D( + PropertyMap().set(IdentifiedObject::NAME_KEY, + transformationName), + crs, GeographicCRS::EPSG_4979, nullptr, gridName, + std::vector<PositionalAccuracyNNPtr>()); + return nn_static_pointer_cast<CRS>(BoundCRS::create( + crs, GeographicCRS::EPSG_4979, transformation)); } - transformationName += " to WGS84 ellipsoidal height"; - auto transformation = - Transformation::createGravityRelatedHeightToGeographic3D( - PropertyMap().set(IdentifiedObject::NAME_KEY, - transformationName), - crs, GeographicCRS::EPSG_4979, nullptr, - stripQuotes(extensionChildren[1]), - std::vector<PositionalAccuracyNNPtr>()); - return nn_static_pointer_cast<CRS>(BoundCRS::create( - crs, GeographicCRS::EPSG_4979, transformation)); } } } |
