diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2022-02-14 23:09:17 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2022-02-14 23:09:17 +0100 |
| commit | 7968d389aa180df520b4924dbc367170048a2ebd (patch) | |
| tree | 390e4d8fbd16013ac8f10684169a3226d8c12f06 /src | |
| parent | d4deb549982a16c0b7b324739af781d2779f2324 (diff) | |
| download | PROJ-7968d389aa180df520b4924dbc367170048a2ebd.tar.gz PROJ-7968d389aa180df520b4924dbc367170048a2ebd.zip | |
Fix importing CRS definition with +proj=peirce_q and +shape different from square or diamond. Follow-up of #3014. Fixes #3056. master only
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/io.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index f047ef3e..02bcf3b0 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -9907,10 +9907,16 @@ PROJStringParser::Private::buildProjectedCRS(int iStep, if (mappings.size() >= 2) { // To distinguish for example +ortho from +ortho +f=0 + bool allMappingsHaveAuxParam = true; + bool foundStrictlyMatchingMapping = false; for (const auto *mappingIter : mappings) { + if (mappingIter->proj_name_aux == nullptr) { + allMappingsHaveAuxParam = false; + } if (mappingIter->proj_name_aux != nullptr && strchr(mappingIter->proj_name_aux, '=') == nullptr && hasParamValue(step, mappingIter->proj_name_aux)) { + foundStrictlyMatchingMapping = true; mapping = mappingIter; break; } else if (mappingIter->proj_name_aux != nullptr && @@ -9918,11 +9924,15 @@ PROJStringParser::Private::buildProjectedCRS(int iStep, const auto tokens = split(mappingIter->proj_name_aux, '='); if (tokens.size() == 2 && getParamValue(step, tokens[0]) == tokens[1]) { + foundStrictlyMatchingMapping = true; mapping = mappingIter; break; } } } + if (allMappingsHaveAuxParam && !foundStrictlyMatchingMapping) { + mapping = nullptr; + } } if (mapping) { |
