diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-10 19:04:32 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-10 19:04:32 +0100 |
| commit | 30205fef7c4a73342a384eca40893a52ea9d6794 (patch) | |
| tree | 8eb49152bcc44e3fd9904b4d17ba57dc9bba69d5 /src/iso19111/factory.cpp | |
| parent | 39ffdcadbd16fdfbf961973be94ae8479441e411 (diff) | |
| download | PROJ-30205fef7c4a73342a384eca40893a52ea9d6794.tar.gz PROJ-30205fef7c4a73342a384eca40893a52ea9d6794.zip | |
CompoundCRS::identify(): avoid exception when horiz/vertical part is a BoundCRS
The exception only affects C++ users. It was caught by the C layer.
Diffstat (limited to 'src/iso19111/factory.cpp')
| -rw-r--r-- | src/iso19111/factory.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 33fce593..0c7692ad 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -5803,7 +5803,9 @@ static std::string buildSqlLookForAuthNameCode( std::set<std::string> authorities; for (const auto &crs : list) { - const auto &ids = crs.first->identifiers(); + auto boundCRS = dynamic_cast<crs::BoundCRS *>(crs.first.get()); + const auto &ids = boundCRS ? boundCRS->baseCRS()->identifiers() + : crs.first->identifiers(); if (!ids.empty()) { authorities.insert(*(ids[0]->codeSpace())); } @@ -5822,7 +5824,9 @@ static std::string buildSqlLookForAuthNameCode( params.emplace_back(auth_name); bool firstGeodCRSForAuth = true; for (const auto &crs : list) { - const auto &ids = crs.first->identifiers(); + auto boundCRS = dynamic_cast<crs::BoundCRS *>(crs.first.get()); + const auto &ids = boundCRS ? boundCRS->baseCRS()->identifiers() + : crs.first->identifiers(); if (!ids.empty() && *(ids[0]->codeSpace()) == auth_name) { if (!firstGeodCRSForAuth) { sql += ','; |
