Skip to content

Commit

Permalink
add coordinate operation to reproject algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy authored and wonder-sk committed Mar 22, 2023
1 parent 27210ce commit 866577f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/analysis/processing/pdal/qgsalgorithmpdalreproject.cpp
Expand Up @@ -61,6 +61,12 @@ void QgsPdalReprojectAlgorithm::initAlgorithm( const QVariantMap & )
{
addParameter( new QgsProcessingParameterPointCloudLayer( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
addParameter( new QgsProcessingParameterCrs( QStringLiteral( "CRS" ), QObject::tr( "Target CRS" ), QStringLiteral( "EPSG:4326" ) ) );

std::unique_ptr< QgsProcessingParameterCoordinateOperation > crsOpParam = std::make_unique< QgsProcessingParameterCoordinateOperation >( QStringLiteral( "OPERATION" ), QObject::tr( "Coordinate operation" ),
QVariant(), QStringLiteral( "INPUT" ), QStringLiteral( "CRS" ), QVariant(), QVariant(), true );
crsOpParam->setFlags( crsOpParam->flags() | QgsProcessingParameterDefinition::FlagAdvanced );
addParameter( crsOpParam.release() );

addParameter( new QgsProcessingParameterPointCloudDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ) ) );
}

Expand All @@ -83,6 +89,12 @@ QStringList QgsPdalReprojectAlgorithm::createArgumentLists( const QVariantMap &p
QStringLiteral( "--transform-crs=%1" ).arg( crs.authid() )
};

const QString coordOp = parameterAsString( parameters, QStringLiteral( "OPERATION" ), context );
if ( !coordOp.isEmpty() )
{
args << QStringLiteral( "--transform-coord-op=%1" ).arg( coordOp );
}

addThreadsParameter( args );
return args;
}
Expand Down

0 comments on commit 866577f

Please sign in to comment.