diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-12 22:43:42 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-15 16:16:31 +0100 |
| commit | 5ddddfac622f40a4de920460b64e88e7b9cb5b68 (patch) | |
| tree | 9474e0fc32b5ab2360c048190f06453350ac3d12 /src/iso19111/crs.cpp | |
| parent | 1b07ef00c55525420cfbc9467016959e709e6862 (diff) | |
| download | PROJ-5ddddfac622f40a4de920460b64e88e7b9cb5b68.tar.gz PROJ-5ddddfac622f40a4de920460b64e88e7b9cb5b68.zip | |
Add C/C++ API to get SQL statements to insert a CRS into database
Diffstat (limited to 'src/iso19111/crs.cpp')
| -rw-r--r-- | src/iso19111/crs.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp index 73c61e2c..65f2087d 100644 --- a/src/iso19111/crs.cpp +++ b/src/iso19111/crs.cpp @@ -4829,7 +4829,14 @@ CompoundCRS::identify(const io::AuthorityFactoryPtr &authorityFactory) const { const auto &thisName(nameStr()); const auto &components = componentReferenceSystems(); - const bool l_implicitCS = components[0]->hasImplicitCS(); + bool l_implicitCS = components[0]->hasImplicitCS(); + if (!l_implicitCS) { + const auto projCRS = + dynamic_cast<const ProjectedCRS *>(components[0].get()); + if (projCRS) { + l_implicitCS = projCRS->baseCRS()->hasImplicitCS(); + } + } const auto crsCriterion = l_implicitCS ? util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS @@ -4949,6 +4956,13 @@ CompoundCRS::identify(const io::AuthorityFactoryPtr &authorityFactory) const { } res.sort(lambdaSort); + + // If there's a single candidate at 90% confidence with same name, + // then promote it to 100% + if (res.size() == 1 && res.front().second == 90 && + thisName == res.front().first->nameStr()) { + res.front().second = 100; + } } // If we didn't find a match for the CompoundCRS, check if the |
