Skip to content
Permalink
Browse files

Fixes #40318 : remove duplicates in CRS list

(cherry picked from commit e8b4c40)
  • Loading branch information
troopa81 authored and nyalldawson committed Feb 19, 2021
1 parent c4299fd commit 8bab4c5a0b0cb96170703b064dad082873526290
Showing with 4 additions and 1 deletion.
  1. +2 −1 src/providers/wms/qgswmscapabilities.cpp
  2. +2 −0 tests/src/providers/testqgswmscapabilities.cpp
@@ -1216,7 +1216,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 8bab4c5

Please sign in to comment.