Skip to content
Permalink
Browse files

apply user nodata to all bands

  • Loading branch information
blazek committed Sep 19, 2012
1 parent e4793d6 commit 35d869cfb35f8d0cbea07bce5e8423ef64e2e287
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/app/qgsrasterlayerproperties.cpp
@@ -660,21 +660,24 @@ void QgsRasterLayerProperties::apply()
*/

//set NoDataValue
bool myDoubleOk = false;
QList<QgsRasterInterface::Range> myNoDataRangeList;
if ( "" != leNoDataValue->text() )
{
QList<QgsRasterInterface::Range> myNoDataRangeList;
bool myDoubleOk = false;
double myNoDataValue = leNoDataValue->text().toDouble( &myDoubleOk );
if ( myDoubleOk )
{
mRasterLayer->setNoDataValue( myNoDataValue );
//mRasterLayer->setNoDataValue( myNoDataValue );
QgsRasterInterface::Range myNoDataRange;
myNoDataRange.min = myNoDataValue;
myNoDataRange.max = myNoDataValue;

myNoDataRangeList << myNoDataRange;
}
mRasterLayer->dataProvider()->setUserNoDataValue( 1, myNoDataRangeList );
}
for ( int bandNo = 1; bandNo <= mRasterLayer->dataProvider()->bandCount(); bandNo++ )
{
mRasterLayer->dataProvider()->setUserNoDataValue( bandNo, myNoDataRangeList );
}

//set renderer from widget

0 comments on commit 35d869c

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