From a377a0e1ac5d2809703e8e83b368f26d171e5f9b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 11 Sep 2019 16:22:32 +0200 Subject: createFromPROJString(): ignore +no_defs when instanciating a '+init=epsg:xxxx +no_defs' string (related to #1597) --- src/iso19111/io.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index dfe6f6a8..550312d8 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(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() -- cgit v1.2.3