Skip to content
Permalink
Browse files

[raster] Remove preexisting pyramid files when over-writing a raster (#…

…7677)

(failing to do so can lead to new raster relying on old pyramid
files, corrupting the rendering)
  • Loading branch information
nirvn committed Aug 24, 2018
1 parent 4bea2ef commit 0782c12ba8847a845c18e1ab12f8731e56b95d49
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/core/raster/qgsrasterfilewriter.cpp
@@ -130,6 +130,14 @@ QgsRasterFileWriter::WriterError QgsRasterFileWriter::writeRaster( const QgsRast
}
}

// Remove pre-existing overview files to avoid using those with new raster
QFile pyramidFile( mOutputUrl + ( mTiledMode ? ".vrt.ovr" : ".ovr" ) );
if ( pyramidFile.exists() )
pyramidFile.remove();
pyramidFile.setFileName( mOutputUrl + ( mTiledMode ? ".vrt.rrd" : ".rrd" ) );
if ( pyramidFile.exists() )
pyramidFile.remove();

if ( mMode == Image )
{
WriterError e = writeImageRaster( &iter, nCols, nRows, outputExtent, crs, feedback );

0 comments on commit 0782c12

Please sign in to comment.
You can’t perform that action at this time.