Skip to content

Commit e5491ee

Browse files
elpasonyalldawson
authored andcommittedApr 17, 2019
Get transformContext from layer instead of provider
1 parent 6372295 commit e5491ee

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎src/analysis/raster/qgsrastercalculator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ QgsRasterCalculator::Result QgsRasterCalculator::processCalculation( QgsFeedback
261261
if ( it->raster->crs() != mOutputCrs )
262262
{
263263
QgsRasterProjector proj;
264-
proj.setCrs( it->raster->crs(), mOutputCrs, it->raster->dataProvider()->transformContext() );
264+
proj.setCrs( it->raster->crs(), mOutputCrs, it->raster->transformContext() );
265265
proj.setInput( it->raster->dataProvider() );
266266
proj.setPrecision( QgsRasterProjector::Exact );
267267

@@ -550,7 +550,7 @@ QgsRasterCalculator::Result QgsRasterCalculator::processCalculationGPU( std::uni
550550
if ( ref.layer->crs() != mOutputCrs )
551551
{
552552
QgsRasterProjector proj;
553-
proj.setCrs( ref.layer->crs(), mOutputCrs, ref.layer->dataProvider()->transformContext() );
553+
proj.setCrs( ref.layer->crs(), mOutputCrs, ref.layer->transformContext() );
554554
proj.setInput( ref.layer->dataProvider() );
555555
proj.setPrecision( QgsRasterProjector::Exact );
556556
block.reset( proj.block( ref.band, rect, mNumOutputColumns, 1 ) );

‎src/server/services/wcs/qgswcsgetcoverage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,14 @@ namespace QgsWcs
201201
if ( responseCRS != rLayer->crs() )
202202
{
203203
QgsRasterProjector *projector = new QgsRasterProjector;
204-
projector->setCrs( rLayer->crs(), responseCRS, rLayer->dataProvider()->transformContext() );
204+
projector->setCrs( rLayer->crs(), responseCRS, rLayer->transformContext() );
205205
if ( !pipe.insert( 2, projector ) )
206206
{
207207
throw QgsRequestNotWellFormedException( QStringLiteral( "Cannot set pipe projector" ) );
208208
}
209209
}
210210

211-
QgsRasterFileWriter::WriterError err = fileWriter.writeRaster( &pipe, width, height, rect, responseCRS, rLayer->dataProvider()->transformContext() );
211+
QgsRasterFileWriter::WriterError err = fileWriter.writeRaster( &pipe, width, height, rect, responseCRS, rLayer->transformContext() );
212212
if ( err != QgsRasterFileWriter::NoError )
213213
{
214214
throw QgsRequestNotWellFormedException( QStringLiteral( "Cannot write raster error code: %1" ).arg( err ) );

‎tests/src/core/testqgsrasterfilewriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ bool TestQgsRasterFileWriter::writeTest( const QString &rasterName )
168168
}
169169
qDebug() << "projector set";
170170

171-
fileWriter.writeRaster( pipe, provider->xSize(), provider->ySize(), provider->extent(), provider->crs() );
171+
fileWriter.writeRaster( pipe, provider->xSize(), provider->ySize(), provider->extent(), provider->crs(), provider->transformContext() );
172172

173173
delete pipe;
174174

@@ -302,7 +302,7 @@ void TestQgsRasterFileWriter::testVrtCreation()
302302
QgsRasterPipe pipe;
303303
pipe.set( srcRasterLayer->dataProvider()->clone() );
304304
// Let's do it !
305-
QgsRasterFileWriter::WriterError res = rasterFileWriter->writeRaster( &pipe, srcRasterLayer->width(), srcRasterLayer->height(), srcRasterLayer->extent(), crs );
305+
QgsRasterFileWriter::WriterError res = rasterFileWriter->writeRaster( &pipe, srcRasterLayer->width(), srcRasterLayer->height(), srcRasterLayer->extent(), crs, srcRasterLayer->transformContext() );
306306
QCOMPARE( res, QgsRasterFileWriter::NoError );
307307

308308
// Now let's compare the georef of the original raster with the georef of the generated vrt file

0 commit comments

Comments
 (0)
Please sign in to comment.