diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-05-01 18:40:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-01 18:40:04 +0200 |
| commit | eeda5f7e5fd94a0cdcbf90df1f0b04a090f4c037 (patch) | |
| tree | 86a8e2a7277351415e0836e37a975b81afd10b1c /src/iso19111/io.cpp | |
| parent | e2b291c0c2a684313143eaf334fbf1161075b449 (diff) | |
| parent | 8c025212b364cca181f1b436068516313032182c (diff) | |
| download | PROJ-eeda5f7e5fd94a0cdcbf90df1f0b04a090f4c037.tar.gz PROJ-eeda5f7e5fd94a0cdcbf90df1f0b04a090f4c037.zip | |
Reduce database size (#1438)
Reduce database size
Diffstat (limited to 'src/iso19111/io.cpp')
| -rw-r--r-- | src/iso19111/io.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index 0a32bb7c..e072a66f 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -757,13 +757,22 @@ const std::string &WKTFormatter::getHDatumExtension() const { // --------------------------------------------------------------------------- std::string WKTFormatter::morphNameToESRI(const std::string &name) { + + for (const auto *suffix : {"(m)", "(ftUS)", "(E-N)", "(N-E)"}) { + if (ends_with(name, suffix)) { + return morphNameToESRI( + name.substr(0, name.size() - strlen(suffix))) + + suffix; + } + } + std::string ret; bool insertUnderscore = false; // Replace any special character by underscore, except at the beginning // and of the name where those characters are removed. for (char ch : name) { - if (ch == '+' || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z')) { + if (ch == '+' || ch == '-' || (ch >= '0' && ch <= '9') || + (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { if (insertUnderscore && !ret.empty()) { ret += '_'; } @@ -3256,7 +3265,10 @@ ConversionNNPtr WKTParser::Private::buildProjectionFromESRI( } return Conversion::create( - PropertyMap().set(IdentifiedObject::NAME_KEY, "unnamed"), + PropertyMap().set(IdentifiedObject::NAME_KEY, + esriProjectionName == "Gauss_Kruger" + ? "unnnamed (Gauss Kruger)" + : "unnamed"), propertiesMethod, parameters, values) ->identify(); } |
