mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Write projection info to raster calculator output
git-svn-id: http://svn.osgeo.org/qgis/trunk@15581 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
313d349515
commit
f1527c7f1a
@ -110,6 +110,19 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
|
||||
return 1;
|
||||
}
|
||||
GDALDatasetH outputDataset = openOutputFile( outputDriver );
|
||||
|
||||
//copy the projection info from the first input raster
|
||||
if ( mRasterEntries.size() > 0 )
|
||||
{
|
||||
QgsRasterLayer* rl = mRasterEntries.at( 0 ).raster;
|
||||
if ( rl )
|
||||
{
|
||||
//proj format would be better, but is not supported e.g. for writing to GeoTiff
|
||||
GDALSetProjection( outputDataset, TO8( rl->crs().toWkt() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset, 1 );
|
||||
|
||||
float outputNodataValue = -FLT_MAX;
|
||||
|
Loading…
x
Reference in New Issue
Block a user