@@ -2055,11 +2055,6 @@ void QgsGdalProvider::initBaseDataset()
2055
2055
bool QgsGdalProvider::create ( const QString& format, int nBands, QgsRasterDataProvider::DataType type, int width, int height,
2056
2056
double * geoTransform, const QgsCoordinateReferenceSystem& crs )
2057
2057
{
2058
- if ( isValid () ) // datasource already exists
2059
- {
2060
- return false ;
2061
- }
2062
-
2063
2058
// get driver
2064
2059
GDALDriverH driver = GDALGetDriverByName ( format.toLocal8Bit ().data () );
2065
2060
if ( !driver )
@@ -2091,12 +2086,12 @@ bool QgsGdalProvider::create( const QString& format, int nBands, QgsRasterDataPr
2091
2086
2092
2087
bool QgsGdalProvider::write ( void * data, int band, int width, int height, int xOffset, int yOffset )
2093
2088
{
2094
- GDALRasterBandH rasterBand = GDALGetRasterBand ( mGdalDataset , band );
2095
- if ( rasterBand == NULL )
2096
- {
2097
- return false ;
2098
- }
2099
- return ( GDALRasterIO ( rasterBand, GF_Write, xOffset, yOffset, width, height, data, width, height, GDALGetRasterDataType ( rasterBand ), 0 , 0 ) == CE_None );
2089
+ GDALRasterBandH rasterBand = GDALGetRasterBand ( mGdalDataset , band );
2090
+ if ( rasterBand == NULL )
2091
+ {
2092
+ return false ;
2093
+ }
2094
+ return ( GDALRasterIO ( rasterBand, GF_Write, xOffset, yOffset, width, height, data, width, height, GDALGetRasterDataType ( rasterBand ), 0 , 0 ) == CE_None );
2100
2095
}
2101
2096
2102
2097
QStringList QgsGdalProvider::createFormats () const
0 commit comments