We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 313d349 commit f1527c7Copy full SHA for f1527c7
src/analysis/raster/qgsrastercalculator.cpp
@@ -110,6 +110,19 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
110
return 1;
111
}
112
GDALDatasetH outputDataset = openOutputFile( outputDriver );
113
+
114
+ //copy the projection info from the first input raster
115
+ if ( mRasterEntries.size() > 0 )
116
+ {
117
+ QgsRasterLayer* rl = mRasterEntries.at( 0 ).raster;
118
+ if ( rl )
119
120
+ //proj format would be better, but is not supported e.g. for writing to GeoTiff
121
+ GDALSetProjection( outputDataset, TO8( rl->crs().toWkt() ) );
122
+ }
123
124
125
126
GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset, 1 );
127
128
float outputNodataValue = -FLT_MAX;
0 commit comments