Skip to content

Commit

Permalink
raster transparency single band ranges, no data in save as, pipe to f…
Browse files Browse the repository at this point in the history
…ile writer
  • Loading branch information
blazek committed Aug 22, 2012
1 parent 9c896b4 commit a2b6bcc
Show file tree
Hide file tree
Showing 18 changed files with 725 additions and 302 deletions.
3 changes: 2 additions & 1 deletion python/core/qgsrastertransparency.sip
Expand Up @@ -21,7 +21,8 @@ public:

struct TransparentSingleValuePixel
{
double pixelValue;
double min;
double max;
double percentTransparent;
};

Expand Down
9 changes: 4 additions & 5 deletions src/app/qgisapp.cpp
Expand Up @@ -3954,10 +3954,10 @@ void QgisApp::saveAsRasterFile()
return;
}
// add projector if necessary
if ( d.outputCrs() != rasterLayer->dataProvider()->crs() )
if ( d.outputCrs() != rasterLayer->crs() )
{
QgsRasterProjector * projector = new QgsRasterProjector;
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
if ( !pipe->set( projector ) )
{
QgsDebugMsg( "Cannot set pipe projector" );
Expand All @@ -3977,18 +3977,17 @@ void QgisApp::saveAsRasterFile()
delete pipe;
return;
}
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
}

if ( !pipe->last() )
{
delete pipe;
return;
}
QgsRasterIterator iterator( pipe->last() );
fileWriter.setCreateOptions( d.createOptions() );

fileWriter.writeRaster( &iterator, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
fileWriter.writeRaster( pipe, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
delete pipe;
}
}
Expand Down

0 comments on commit a2b6bcc

Please sign in to comment.