Fix #10663 (additional nodata value pixels not transparent)

This commit is contained in:
Martin Dobias 2014-06-22 23:18:48 +07:00
parent 0d360d450a
commit e8d80a36de
6 changed files with 19 additions and 1 deletions

View File

@ -513,4 +513,14 @@ bool QgsRasterDataProvider::userNoDataValuesContains( int bandNo, double value )
return QgsRasterRange::contains( value, rangeList );
}
void QgsRasterDataProvider::copyBaseSettings( const QgsRasterDataProvider& other )
{
mDpi = other.mDpi;
mSrcNoDataValue = other.mSrcNoDataValue;
mSrcHasNoDataValue = other.mSrcHasNoDataValue;
mUseSrcNoDataValue = other.mUseSrcNoDataValue;
mUserNoDataValue = other.mUserNoDataValue;
mExtent = other.mExtent;
}
// ENDS

View File

@ -379,6 +379,9 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
/** Returns true if user no data contains value */
bool userNoDataValuesContains( int bandNo, double value ) const;
/** Copy member variables from other raster data provider. Useful for implementation of clone() method in subclasses */
void copyBaseSettings( const QgsRasterDataProvider& other );
static QStringList cStringList2Q_( char ** stringList );
static QString makeTableCell( const QString & value );

View File

@ -157,6 +157,7 @@ QgsRasterInterface * QgsGdalProvider::clone() const
{
QgsDebugMsg( "Entered" );
QgsGdalProvider * provider = new QgsGdalProvider( dataSourceUri() );
provider->copyBaseSettings( *this );
return provider;
}

View File

@ -154,6 +154,7 @@ QgsGrassRasterProvider::~QgsGrassRasterProvider()
QgsRasterInterface * QgsGrassRasterProvider::clone() const
{
QgsGrassRasterProvider * provider = new QgsGrassRasterProvider( dataSourceUri() );
provider->copyBaseSettings( *this );
return provider;
}

View File

@ -459,6 +459,7 @@ QgsWcsProvider::~QgsWcsProvider()
QgsRasterInterface * QgsWcsProvider::clone() const
{
QgsWcsProvider * provider = new QgsWcsProvider( dataSourceUri() );
provider->copyBaseSettings( *this );
return provider;
}

View File

@ -185,7 +185,9 @@ QgsWmsProvider::~QgsWmsProvider()
QgsRasterInterface * QgsWmsProvider::clone() const
{
return new QgsWmsProvider( dataSourceUri(), mCaps.isValid() ? &mCaps : 0 );
QgsWmsProvider* provider = new QgsWmsProvider( dataSourceUri(), mCaps.isValid() ? &mCaps : 0 );
provider->copyBaseSettings( *this );
return provider;
}