mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
[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)
This commit is contained in:
parent
04cdc9bf30
commit
bf0962fa9c
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user