Skip to content
Permalink
Browse files

raster saveas rendered with QgsSingleBandPseudoColorRenderer fix

  • Loading branch information
blazek committed Sep 17, 2012
1 parent a544133 commit 8c8d02853b5d95e3dfca66d92e18ea8d13535b42
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/core/raster/qgssinglebandpseudocolorrenderer.cpp
@@ -36,11 +36,27 @@ QgsSingleBandPseudoColorRenderer::~QgsSingleBandPseudoColorRenderer()
QgsRasterInterface * QgsSingleBandPseudoColorRenderer::clone() const
{
QgsRasterShader *shader = 0;

if ( mShader )
{
shader = new QgsRasterShader( mShader->minimumValue(), mShader->maximumValue() );

// Shader function
const QgsColorRampShader* origColorRampShader = dynamic_cast<const QgsColorRampShader*>( mShader->rasterShaderFunction() );

if ( origColorRampShader )
{
QgsColorRampShader * colorRampShader = new QgsColorRampShader( mShader->minimumValue(), mShader->maximumValue() );

colorRampShader->setColorRampType( origColorRampShader->colorRampType() );

colorRampShader->setColorRampItemList( origColorRampShader->colorRampItemList() );
shader->setRasterShaderFunction( colorRampShader );
}
}
QgsSingleBandPseudoColorRenderer * renderer = new QgsSingleBandPseudoColorRenderer( 0, mBand, shader );


return renderer;
}

@@ -91,7 +107,7 @@ void * QgsSingleBandPseudoColorRenderer::readBlock( int bandNo, QgsRectangle co
void* rasterData = mInput->block( mBand, extent, width, height );
if ( ! rasterData )
{
QgsDebugMsg("No raster data!" );
QgsDebugMsg( "No raster data!" );
return 0;
}

0 comments on commit 8c8d028

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