aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-10 19:04:32 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-11 11:56:57 +0100
commit7d46771382e394586477b0edd7833a89369bb248 (patch)
treea9f3f7f782c64995fa9f0c2fb569a405a8358a23 /src
parent91e360027bad225b7914b1fe7bdecfa73124a39c (diff)
downloadPROJ-7d46771382e394586477b0edd7833a89369bb248.tar.gz
PROJ-7d46771382e394586477b0edd7833a89369bb248.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')
-rw-r--r--src/iso19111/factory.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp
index 0bd44308..4989e634 100644
--- a/src/iso19111/factory.cpp
+++ b/src/iso19111/factory.cpp
@@ -5751,7 +5751,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()));
}
@@ -5770,7 +5772,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 += ',';