@@ -333,11 +333,15 @@ bool QgsRasterLayer::draw( QgsRenderContext& rendererContext )
333
333
{
334
334
myRasterViewPort->mSrcCRS = crs ();
335
335
myRasterViewPort->mDestCRS = rendererContext.coordinateTransform ()->destCRS ();
336
+ myRasterViewPort->mSrcDatumTransform = rendererContext.coordinateTransform ()->sourceDatumTransform ();
337
+ myRasterViewPort->mDestDatumTransform = rendererContext.coordinateTransform ()->destinationDatumTransform ();
336
338
}
337
339
else
338
340
{
339
341
myRasterViewPort->mSrcCRS = QgsCoordinateReferenceSystem (); // will be invalid
340
342
myRasterViewPort->mDestCRS = QgsCoordinateReferenceSystem (); // will be invalid
343
+ myRasterViewPort->mSrcDatumTransform = -1 ;
344
+ myRasterViewPort->mDestDatumTransform = -1 ;
341
345
}
342
346
343
347
// get dimensions of clipped raster image in device coordinate space (this is the size of the viewport)
@@ -423,7 +427,7 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
423
427
// params in QgsRasterProjector
424
428
if ( projector )
425
429
{
426
- projector->setCRS ( theRasterViewPort->mSrcCRS , theRasterViewPort->mDestCRS );
430
+ projector->setCRS ( theRasterViewPort->mSrcCRS , theRasterViewPort->mDestCRS , theRasterViewPort-> mSrcDatumTransform , theRasterViewPort-> mDestDatumTransform );
427
431
}
428
432
429
433
// Drawer to pipe?
@@ -1257,6 +1261,8 @@ QPixmap QgsRasterLayer::previewAsPixmap( QSize size, QColor bgColor )
1257
1261
myRasterViewPort->mDrawnExtent = myExtent;
1258
1262
myRasterViewPort->mSrcCRS = QgsCoordinateReferenceSystem (); // will be invalid
1259
1263
myRasterViewPort->mDestCRS = QgsCoordinateReferenceSystem (); // will be invalid
1264
+ myRasterViewPort->mSrcDatumTransform = -1 ;
1265
+ myRasterViewPort->mDestDatumTransform = -1 ;
1260
1266
1261
1267
QgsMapToPixel *myMapToPixel = new QgsMapToPixel ( myMapUnitsPerPixel );
1262
1268
0 commit comments