Skip to content

Commit

Permalink
Merge pull request #9098 from alexbruy/wcs-backport
Browse files Browse the repository at this point in the history
Wcs backport
  • Loading branch information
alexbruy committed Feb 5, 2019
2 parents 526a6b6 + 9a5143d commit 7aca6af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
25 changes: 23 additions & 2 deletions src/providers/wcs/qgswcscapabilities.cpp
Expand Up @@ -790,7 +790,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( "," ) );

Expand All @@ -813,7 +830,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() )
Expand Down
1 change: 0 additions & 1 deletion src/providers/wcs/qgswcssourceselect.cpp
Expand Up @@ -226,7 +226,6 @@ QStringList QgsWCSSourceSelect::selectedLayersFormats()

QStringList QgsWCSSourceSelect::selectedLayersCrses()
{

QString identifier = selectedIdentifier();
if ( identifier.isEmpty() ) { return QStringList(); }

Expand Down

0 comments on commit 7aca6af

Please sign in to comment.