Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
skip COPC inputs in the "Create COPC" algorithm (fix #53157)
  • Loading branch information
alexbruy authored and nyalldawson committed May 22, 2023
1 parent 3db86bc commit 617a435
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/analysis/processing/pdal/qgsalgorithmpdalcreatecopc.cpp
Expand Up @@ -118,20 +118,26 @@ QVariantMap QgsPdalCreateCopcAlgorithm::processAlgorithm( const QVariantMap &par

feedback->pushInfo( QObject::tr( "Processing layer %1/%2: %3" ).arg( i ).arg( layers.count() ).arg( layer ? layer->name() : QString() ) );

if ( pcl->source().endsWith( QStringLiteral( ".copc.laz" ), Qt::CaseInsensitive ) )
{
feedback->pushInfo( QObject::tr( "File %1 is a COPC file. Skipping…" ).arg( pcl->source() ) );
continue;
}

const QFileInfo fi( pcl->source() );
const QDir directory = fi.absoluteDir();
const QString outputFile = QStringLiteral( "%1/%2.copc.laz" ).arg( outputDir.isEmpty() ? directory.absolutePath() : outputDir ).arg( fi.completeBaseName() );

const QFileInfo outputFileInfo( outputFile );
if ( outputFileInfo.exists() )
{
feedback->pushInfo( QObject::tr( "File %1 is already indexed" ).arg( pcl->source() ) );
feedback->pushInfo( QObject::tr( "File %1 is already indexed. Skipping…" ).arg( pcl->source() ) );
continue;
}
QString tmpDir = outputFile + QStringLiteral( "_tmp" );
if ( QDir( tmpDir ).exists() )
{
feedback->pushInfo( QObject::tr( "Another indexing process is running (or finished with crash) in directory %1" ).arg( tmpDir ) );
feedback->pushInfo( QObject::tr( "Another indexing process is running (or finished with crash) in directory %1." ).arg( tmpDir ) );
continue;
}

Expand Down

0 comments on commit 617a435

Please sign in to comment.