Skip to content

Commit

Permalink
Fix cherry-picking [BUGFIX][Server] WMS compliance: stretched, distor…
Browse files Browse the repository at this point in the history
…t, increase, decrease
  • Loading branch information
rldhont committed Jan 3, 2017
1 parent 6140cb6 commit 5429f4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/qgswmsserver.cpp
Expand Up @@ -2001,8 +2001,8 @@ QImage* QgsWMSServer::createImage( int width, int height, bool useBbox ) const


//Adapt width / height if the aspect ratio does not correspond with the BBOX. //Adapt width / height if the aspect ratio does not correspond with the BBOX.
//Required by WMS spec. 1.3. //Required by WMS spec. 1.3.
QString version = mParameters.value( QStringLiteral( "VERSION" ), QStringLiteral( "1.3.0" ) ); QString version = mParameters.value( "VERSION", "1.3.0" );
if ( useBbox && version != QLatin1String( "1.1.1" ) ) if ( useBbox && version != "1.1.1" )
{ {
bool bboxOk; bool bboxOk;
QgsRectangle mapExtent = _parseBBOX( mParameters.value( "BBOX" ), bboxOk ); QgsRectangle mapExtent = _parseBBOX( mParameters.value( "BBOX" ), bboxOk );
Expand All @@ -2012,8 +2012,8 @@ QImage* QgsWMSServer::createImage( int width, int height, bool useBbox ) const
crs = QString( "EPSG:4326" ); crs = QString( "EPSG:4326" );
mapExtent.invert(); mapExtent.invert();
} }
QgsCoordinateReferenceSystem outputCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( crs ); QgsCoordinateReferenceSystem outputCRS = QgsCRSCache::instance()->crsByOgcWmsCrs( crs );
if ( outputCRS.hasAxisInverted() ) if ( outputCRS.axisInverted() )
{ {
mapExtent.invert(); mapExtent.invert();
} }
Expand Down

0 comments on commit 5429f4a

Please sign in to comment.