Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] Fix Repair Shapefile alg
Unset the SHAPE_RESTORE_SHX GDAL option also when the algorithm fails.
  • Loading branch information
agiudiceandrea authored and nyalldawson committed May 16, 2023
1 parent 0b0f52b commit 5abcc13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/analysis/processing/qgsalgorithmrepairshapefile.cpp
Expand Up @@ -82,7 +82,10 @@ QVariantMap QgsRepairShapefileAlgorithm::processAlgorithm( const QVariantMap &pa

std::unique_ptr< QgsVectorLayer > layer = std::make_unique< QgsVectorLayer >( path );
if ( !layer->isValid() )
{
CPLSetConfigOption( "SHAPE_RESTORE_SHX", nullptr );
throw QgsProcessingException( QObject::tr( "Could not repair %1." ).arg( path ) );
}

CPLSetConfigOption( "SHAPE_RESTORE_SHX", nullptr );

Expand Down

0 comments on commit 5abcc13

Please sign in to comment.