Skip to content

Commit

Permalink
fixStepsDirection(): pass database context
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jul 11, 2023
1 parent 2e86a0a commit 22db697
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion include/proj/coordinateoperation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,8 @@ class PROJ_GCC_DLL ConcatenatedOperation final : public CoordinateOperation {
PROJ_INTERNAL static void
fixStepsDirection(const crs::CRSNNPtr &concatOpSourceCRS,
const crs::CRSNNPtr &concatOpTargetCRS,
std::vector<CoordinateOperationNNPtr> &operationsInOut);
std::vector<CoordinateOperationNNPtr> &operationsInOut,
const io::DatabaseContextPtr &dbContext);
//! @endcond

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/iso19111/factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6257,7 +6257,7 @@ operation::CoordinateOperationNNPtr AuthorityFactory::createCoordinateOperation(
->createCoordinateReferenceSystem(source_crs_code),
d->createFactory(target_crs_auth_name)
->createCoordinateReferenceSystem(target_crs_code),
operations);
operations, d->context());

auto props = d->createPropertiesSearchUsages(
type, code, name, deprecated, description);
Expand Down
5 changes: 3 additions & 2 deletions src/iso19111/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3641,7 +3641,7 @@ WKTParser::Private::buildConcatenatedOperation(const WKTNodeNNPtr &node) {
}

ConcatenatedOperation::fixStepsDirection(
NN_NO_CHECK(sourceCRS), NN_NO_CHECK(targetCRS), operations);
NN_NO_CHECK(sourceCRS), NN_NO_CHECK(targetCRS), operations, dbContext_);

std::vector<PositionalAccuracyNNPtr> accuracies;
auto &accuracyNode = nodeP->lookForChild(WKTConstants::OPERATIONACCURACY);
Expand Down Expand Up @@ -6580,7 +6580,8 @@ JSONParser::buildConcatenatedOperation(const json &j) {
operations.emplace_back(NN_NO_CHECK(op));
}

ConcatenatedOperation::fixStepsDirection(sourceCRS, targetCRS, operations);
ConcatenatedOperation::fixStepsDirection(sourceCRS, targetCRS, operations,
dbContext_);

std::vector<PositionalAccuracyNNPtr> accuracies;
if (j.contains("accuracy")) {
Expand Down
3 changes: 2 additions & 1 deletion src/iso19111/operation/concatenatedoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ ConcatenatedOperationNNPtr ConcatenatedOperation::create(
void ConcatenatedOperation::fixStepsDirection(
const crs::CRSNNPtr &concatOpSourceCRS,
const crs::CRSNNPtr &concatOpTargetCRS,
std::vector<CoordinateOperationNNPtr> &operationsInOut) {
std::vector<CoordinateOperationNNPtr> &operationsInOut,
const io::DatabaseContextPtr & /*dbContext*/) {

// Set of heuristics to assign CRS to steps, and possibly reverse them.

Expand Down

0 comments on commit 22db697

Please sign in to comment.