Skip to content

Commit a2b6bcc

Browse files
committedAug 22, 2012
raster transparency single band ranges, no data in save as, pipe to file writer
1 parent 9c896b4 commit a2b6bcc

18 files changed

+725
-302
lines changed
 

‎python/core/qgsrastertransparency.sip

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public:
2121

2222
struct TransparentSingleValuePixel
2323
{
24-
double pixelValue;
24+
double min;
25+
double max;
2526
double percentTransparent;
2627
};
2728

‎src/app/qgisapp.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3954,10 +3954,10 @@ void QgisApp::saveAsRasterFile()
39543954
return;
39553955
}
39563956
// add projector if necessary
3957-
if ( d.outputCrs() != rasterLayer->dataProvider()->crs() )
3957+
if ( d.outputCrs() != rasterLayer->crs() )
39583958
{
39593959
QgsRasterProjector * projector = new QgsRasterProjector;
3960-
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
3960+
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
39613961
if ( !pipe->set( projector ) )
39623962
{
39633963
QgsDebugMsg( "Cannot set pipe projector" );
@@ -3977,18 +3977,17 @@ void QgisApp::saveAsRasterFile()
39773977
delete pipe;
39783978
return;
39793979
}
3980-
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
3980+
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
39813981
}
39823982

39833983
if ( !pipe->last() )
39843984
{
39853985
delete pipe;
39863986
return;
39873987
}
3988-
QgsRasterIterator iterator( pipe->last() );
39893988
fileWriter.setCreateOptions( d.createOptions() );
39903989

3991-
fileWriter.writeRaster( &iterator, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
3990+
fileWriter.writeRaster( pipe, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
39923991
delete pipe;
39933992
}
39943993
}

0 commit comments

Comments
 (0)
Please sign in to comment.