Skip to content

Commit

Permalink
projinfo: allow CoordinateMetadata <--> CoordinateMetadata transforma…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
rouault committed Aug 18, 2023
1 parent 0db85a3 commit 4b35845
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/apps/projinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,14 +879,6 @@ static void outputOperations(
}
}

if (sourceCoordinateMetadata != nullptr &&
targetCoordinateMetadata != nullptr) {
std::cerr << "CoordinateMetadata with epoch to CoordinateMetadata "
"with epoch not supported currently."
<< std::endl;
std::exit(1);
}

// TODO: handle promotion of CoordinateMetadata
if (sourceCRS && targetCRS && dbContext && !promoteTo3D) {
// Auto-promote source/target CRS if it is specified by its name,
Expand Down Expand Up @@ -927,6 +919,12 @@ static void outputOperations(

const auto createOperations = [&]() {
if (sourceCoordinateMetadata) {
if (targetCoordinateMetadata) {
return CoordinateOperationFactory::create()
->createOperations(
NN_NO_CHECK(sourceCoordinateMetadata),
NN_NO_CHECK(targetCoordinateMetadata), ctxt);
}
return CoordinateOperationFactory::create()->createOperations(
NN_NO_CHECK(sourceCoordinateMetadata),
NN_NO_CHECK(targetCRS), ctxt);
Expand Down

0 comments on commit 4b35845

Please sign in to comment.