Skip to content

Commit

Permalink
Fixes #40318 : remove duplicates in CRS list
Browse files Browse the repository at this point in the history
  • Loading branch information
troopa81 authored and github-actions[bot] committed Feb 12, 2021
1 parent dbd1c41 commit c4ba1d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/wms/qgswmscapabilities.cpp
Expand Up @@ -1229,7 +1229,8 @@ void QgsWmsCapabilities::parseLayer( const QDomElement &element, QgsWmsLayerProp
const QStringList crsList = nodeElement.text().split( QRegExp( "\\s+" ) );
for ( const QString &srs : crsList )
{
layerProperty.crs.push_back( srs );
if ( !layerProperty.crs.contains( srs ) )
layerProperty.crs.push_back( srs );
}
}
else if ( tagName == QLatin1String( "LatLonBoundingBox" ) ) // legacy from earlier versions of WMS
Expand Down
2 changes: 2 additions & 0 deletions tests/src/providers/testqgswmscapabilities.cpp
Expand Up @@ -77,6 +77,8 @@ class TestQgsWmsCapabilities: public QObject
QCOMPARE( capabilities.supportedLayers()[0].style[1].legendUrl.size(), 1 );
QCOMPARE( capabilities.supportedLayers()[0].style[1].legendUrl[0].onlineResource.xlinkHref,
QString( "http://www.example.com/fb.png" ) );

QCOMPARE( capabilities.supportedLayers()[0].crs, QStringList() << QStringLiteral( "EPSG:2056" ) );
}

void guessCrs()
Expand Down

0 comments on commit c4ba1d5

Please sign in to comment.