Skip to content
Permalink
Browse files

[BUGFIX][QGIS Server] Add layer coordinate transforms before setting …

…destination CRS

If the layer_coordinate_transform_info child of mapcanvas has not been well
 saved, the destinationCrs is not well applied and we get a blank image.

To resolve this issue, we just have to add layer coordinate transforms to the
 map renderer before setting the destination CRS.
  • Loading branch information
rldhont committed Oct 13, 2015
1 parent 8aaf763 commit 25aca80e6d75db7e8bba4929454a10ae4bf0b436
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/server/qgswmsserver.cpp
@@ -1808,9 +1808,6 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const
throw QgsMapServiceException( "InvalidCRS", "Could not create output CRS" );
return 5;
}
mMapRenderer->setDestinationCrs( outputCRS );
mMapRenderer->setProjectionsEnabled( true );
mapUnits = outputCRS.mapUnits();

//read layer coordinate transforms from project file (e.g. ct with special datum shift)
if ( mConfigParser )
@@ -1823,6 +1820,11 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const
mMapRenderer->addLayerCoordinateTransform( ltIt->first, t.srcAuthId, t.destAuthId, t.srcDatumTransform, t.destDatumTransform );
}
}

//then set destinationCrs
mMapRenderer->setDestinationCrs( outputCRS );
mMapRenderer->setProjectionsEnabled( true );
mapUnits = outputCRS.mapUnits();
}
mMapRenderer->setMapUnits( mapUnits );

0 comments on commit 25aca80

Please sign in to comment.
You can’t perform that action at this time.