aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/datum.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-10-12 10:58:55 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-10-12 10:58:55 +0200
commit4387332ea628282570d712d5b4b6dccc2ea5e604 (patch)
tree6ee6f4dc7f403fe38479c7eaf915c9e8e61be3c6 /src/iso19111/datum.cpp
parent6a877010114b7ccc12d017989500fa5f12f9e39c (diff)
downloadPROJ-4387332ea628282570d712d5b4b6dccc2ea5e604.tar.gz
PROJ-4387332ea628282570d712d5b4b6dccc2ea5e604.zip
Fix export to WKT1:ESRI of CRS, datum, ellipsoids name that don't have a EPSG equivalent and have parentheses in their name
Diffstat (limited to 'src/iso19111/datum.cpp')
-rw-r--r--src/iso19111/datum.cpp48
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);
}