Skip to content
Permalink
Browse files

Fixes #40318 : remove duplicates in CRS list

  • Loading branch information
troopa81 authored and github-actions committed Feb 12, 2021
1 parent dbd1c41 commit c4ba1d5f989de724a2a910b06a8d04de0464e33c
Showing with 4 additions and 1 deletion.
  1. +2 −1 src/providers/wms/qgswmscapabilities.cpp
  2. +2 −0 tests/src/providers/testqgswmscapabilities.cpp
@@ -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
@@ -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()

0 comments on commit c4ba1d5

Please sign in to comment.