WMS 1.3.0 compliance: CRS:84 needs to be supported

This commit is contained in:
Marco Hugentobler 2016-11-29 11:56:50 +01:00
parent ae64430719
commit 4659fd40d2
2 changed files with 8 additions and 0 deletions

View File

@ -65,6 +65,9 @@ void QgsConfigParserUtils::appendCrsElementsToLayer( QDomElement& layerElement,
appendCrsElementToLayer( layerElement, CRSPrecedingElement, crs, doc );
}
}
//Support for CRS:84 is mandatory (equals EPSG:4326 with reversed axis)
appendCrsElementToLayer( layerElement, CRSPrecedingElement, QString( "CRS:84" ), doc );
}
void QgsConfigParserUtils::appendCrsElementToLayer( QDomElement& layerElement, const QDomElement& precedingElement,

View File

@ -2047,6 +2047,11 @@ int QgsWmsServer::configureMapRender( const QPaintDevice* paintDevice ) const
QgsUnitTypes::DistanceUnit mapUnits = QgsUnitTypes::DistanceDegrees;
QString crs = mParameters.value( QStringLiteral( "CRS" ), mParameters.value( QStringLiteral( "SRS" ) ) );
if ( crs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 )
{
crs = QString( "EPSG:4326" );
mapExtent.invert();
}
QgsCoordinateReferenceSystem outputCRS;