Skip to content
Permalink
Browse files

Fix #10663 (additional nodata value pixels not transparent)

  • Loading branch information
wonder-sk committed Jun 22, 2014
1 parent 0d360d4 commit e8d80a36de4f9d5951e8dc2e88cbd1993ee26aea
@@ -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
@@ -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 );
@@ -157,6 +157,7 @@ QgsRasterInterface * QgsGdalProvider::clone() const
{
QgsDebugMsg( "Entered" );
QgsGdalProvider * provider = new QgsGdalProvider( dataSourceUri() );
provider->copyBaseSettings( *this );
return provider;
}

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

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

@@ -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;
}


0 comments on commit e8d80a3

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