aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/crs.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-11-04 15:24:44 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-11-04 18:50:36 +0100
commit848ee7b6a8bf56a9d967f104ba2ef2ad92dc48d5 (patch)
tree6dcf64f6e3e351249928227ef11e74c1b21d3133 /src/iso19111/crs.cpp
parent9c28184f6f32aeaa2951c994453c4f99572a11dc (diff)
downloadPROJ-848ee7b6a8bf56a9d967f104ba2ef2ad92dc48d5.tar.gz
PROJ-848ee7b6a8bf56a9d967f104ba2ef2ad92dc48d5.zip
createBoundCRSToWGS84IfPossible(): make it return same result with a CRS built from EPSG code or WKT1
Related to https://github.com/OSGeo/gdal/issues/3144
Diffstat (limited to 'src/iso19111/crs.cpp')
-rw-r--r--src/iso19111/crs.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp
index edc8a71f..84b98984 100644
--- a/src/iso19111/crs.cpp
+++ b/src/iso19111/crs.cpp
@@ -533,8 +533,12 @@ CRSNNPtr CRS::createBoundCRSToWGS84IfPossible(
auto authFactory = io::AuthorityFactory::create(
NN_NO_CHECK(dbContext),
authority == "any" ? std::string() : authority);
+ metadata::ExtentPtr extentResolved(extent);
+ if (!extent) {
+ getResolvedCRS(thisAsCRS, authFactory, extentResolved);
+ }
auto ctxt = operation::CoordinateOperationContext::create(
- authFactory, extent, 0.0);
+ authFactory, extentResolved, 0.0);
ctxt->setAllowUseIntermediateCRS(allowIntermediateCRSUse);
// ctxt->setSpatialCriterion(
// operation::CoordinateOperationContext::SpatialCriterion::PARTIAL_INTERSECTION);