diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-10-15 23:33:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-15 23:33:52 +0200 |
| commit | 3aad65681afc77d054ce0f271ca64c24f0b3d2f9 (patch) | |
| tree | f79929b13555dd198a8dbb325691803621b231f2 /src/iso19111/datum.cpp | |
| parent | 6a877010114b7ccc12d017989500fa5f12f9e39c (diff) | |
| parent | 785a6507068c7e8ae28d4286028ea0d12f607213 (diff) | |
| download | PROJ-3aad65681afc77d054ce0f271ca64c24f0b3d2f9.tar.gz PROJ-3aad65681afc77d054ce0f271ca64c24f0b3d2f9.zip | |
Merge pull request #2902 from rouault/issue_2757
Geographic 3D CRS: allow to export to WKT1:ESRI if only the GEOGCS is known (and thus extrapolating a VERTCS) (fixes #2757)
Diffstat (limited to 'src/iso19111/datum.cpp')
| -rw-r--r-- | src/iso19111/datum.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp index ebef94a2..7c76061e 100644 --- a/src/iso19111/datum.cpp +++ b/src/iso19111/datum.cpp @@ -363,6 +363,18 @@ void PrimeMeridian::_exportToWKT( aliasFound = true; } } + if (!aliasFound && dbContext) { + auto authFactory = io::AuthorityFactory::create( + NN_NO_CHECK(dbContext), "ESRI"); + aliasFound = + authFactory + ->createObjectsFromName( + l_name, + {io::AuthorityFactory::ObjectType::PRIME_MERIDIAN}, + false // approximateMatch + ) + .size() == 1; + } if (!aliasFound) { l_name = io::WKTFormatter::morphNameToESRI(l_name); } @@ -820,6 +832,18 @@ void Ellipsoid::_exportToWKT( aliasFound = true; } } + if (!aliasFound && dbContext) { + auto authFactory = io::AuthorityFactory::create( + NN_NO_CHECK(dbContext), "ESRI"); + aliasFound = authFactory + ->createObjectsFromName( + l_name, + {io::AuthorityFactory::ObjectType:: + ELLIPSOID}, + false // approximateMatch + ) + .size() == 1; + } if (!aliasFound) { l_name = io::WKTFormatter::morphNameToESRI(l_name); } @@ -1247,6 +1271,18 @@ void GeodeticReferenceFrame::_exportToWKT( } } } + if (!aliasFound && dbContext) { + auto authFactory = io::AuthorityFactory::create( + NN_NO_CHECK(dbContext), "ESRI"); + aliasFound = authFactory + ->createObjectsFromName( + l_name, + {io::AuthorityFactory::ObjectType:: + GEODETIC_REFERENCE_FRAME}, + false // approximateMatch + ) + .size() == 1; + } if (!aliasFound) { l_name = io::WKTFormatter::morphNameToESRI(l_name); if (!starts_with(l_name, "D_")) { @@ -1985,6 +2021,18 @@ void VerticalReferenceFrame::_exportToWKT( aliasFound = true; } } + if (!aliasFound && dbContext) { + auto authFactory = io::AuthorityFactory::create( + NN_NO_CHECK(dbContext), "ESRI"); + aliasFound = authFactory + ->createObjectsFromName( + l_name, + {io::AuthorityFactory::ObjectType:: + VERTICAL_REFERENCE_FRAME}, + false // approximateMatch + ) + .size() == 1; + } if (!aliasFound) { l_name = io::WKTFormatter::morphNameToESRI(l_name); } |
