mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Merge pull request #9005 from alexbruy/wcs-fix
fix CRS handling in the DescribeCoverage response (refs #21045) [wcs]
This commit is contained in:
commit
e953141fe0
@ -794,7 +794,24 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom10( QByteArray const &xml, QgsW
|
||||
QDomElement supportedCRSsElement = firstChild( coverageOfferingElement, QStringLiteral( "supportedCRSs" ) );
|
||||
|
||||
// requestResponseCRSs and requestCRSs + responseCRSs are alternatives
|
||||
coverage->supportedCrs = domElementsTexts( coverageOfferingElement, QStringLiteral( "supportedCRSs.requestResponseCRSs" ) );
|
||||
// we try to parse one or the other
|
||||
QStringList crsList;
|
||||
crsList = domElementsTexts( coverageOfferingElement, QStringLiteral( "supportedCRSs.requestResponseCRSs" ) );
|
||||
if ( crsList.isEmpty() )
|
||||
{
|
||||
crsList = domElementsTexts( coverageOfferingElement, QStringLiteral( "supportedCRSs.requestCRSs" ) );
|
||||
crsList << domElementsTexts( coverageOfferingElement, QStringLiteral( "supportedCRSs.responseCRSs" ) );
|
||||
}
|
||||
|
||||
// exclude invalid CRSs from the lists
|
||||
for ( const QString &crsid : qgis::as_const( crsList ) )
|
||||
{
|
||||
if ( QgsCoordinateReferenceSystem::fromOgcWmsCrs( crsid ).isValid() )
|
||||
{
|
||||
coverage->supportedCrs << crsid;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: requestCRSs, responseCRSs - must be then implemented also in provider
|
||||
//QgsDebugMsg( "supportedCrs = " + coverage->supportedCrs.join( "," ) );
|
||||
|
||||
@ -817,7 +834,11 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom10( QByteArray const &xml, QgsW
|
||||
// If supportedCRSs.nativeCRSs is not defined we try to get it from RectifiedGrid
|
||||
if ( coverage->nativeCrs.isEmpty() )
|
||||
{
|
||||
coverage->nativeCrs = gridElement.attribute( QStringLiteral( "srsName" ) );
|
||||
QString crs = gridElement.attribute( QStringLiteral( "srsName" ) );
|
||||
if ( QgsCoordinateReferenceSystem::fromOgcWmsCrs( crs ).isValid() )
|
||||
{
|
||||
coverage->nativeCrs = crs;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !gridElement.isNull() )
|
||||
|
@ -226,7 +226,6 @@ QStringList QgsWCSSourceSelect::selectedLayersFormats()
|
||||
|
||||
QStringList QgsWCSSourceSelect::selectedLayersCrses()
|
||||
{
|
||||
|
||||
QString identifier = selectedIdentifier();
|
||||
if ( identifier.isEmpty() ) { return QStringList(); }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user