aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-09-11 14:22:32 +0000
committerEven Rouault <even.rouault@spatialys.com>2019-09-15 11:20:43 +0000
commit9e5807499c5a37d31f983cd58eb21c918daf1fef (patch)
tree51acf61896d83ad8109212d821f856094295d4ac /src
parentb7e7a3bd4a85ce07cc9dee457f3c44be43950084 (diff)
downloadPROJ-9e5807499c5a37d31f983cd58eb21c918daf1fef.tar.gz
PROJ-9e5807499c5a37d31f983cd58eb21c918daf1fef.zip
createFromPROJString(): ignore +no_defs when instanciating a '+init=epsg:xxxx +no_defs' string (related to #1597)
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/io.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index e5cabd3d..ebccf78b 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -8759,10 +8759,17 @@ PROJStringParser::createFromPROJString(const std::string &projString) {
if (!file_found) {
auto obj = createFromUserInput(stepName, d->dbContext_, true);
auto crs = dynamic_cast<CRS *>(obj.get());
- if (crs &&
- (d->steps_[0].paramValues.empty() ||
- (d->steps_[0].paramValues.size() == 1 &&
- d->getParamValue(d->steps_[0], "type") == "crs"))) {
+
+ bool hasSignificantParamValues = false;
+ for (const auto &kv : d->steps_[0].paramValues) {
+ if (!((kv.key == "type" && kv.value == "crs") ||
+ kv.key == "no_defs")) {
+ hasSignificantParamValues = true;
+ break;
+ }
+ }
+
+ if (crs && !hasSignificantParamValues) {
PropertyMap properties;
properties.set(IdentifiedObject::NAME_KEY,
d->title_.empty() ? crs->nameStr()