Skip to content
Permalink
Browse files

[BUGFIX] WFS GetCapabilities respons misses <keywords> key

Fixes #13037 WFS GetCapabilities respons misses <keywords> key

Replace KeywordList by Keywords in WFS Getcapabilities and keywords in WCS GetCapabilities.
  • Loading branch information
rldhont committed Dec 18, 2015
1 parent 52f6b73 commit 746af79428668bdb727f11c561ad0e0639316f3d
Showing with 30 additions and 12 deletions.
  1. +30 −12 src/server/qgsserverprojectparser.cpp
@@ -420,22 +420,40 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD
QDomElement keywordListElem = propertiesElement.firstChildElement( "WMSKeywordList" );
if ( !keywordListElem.isNull() && !keywordListElem.text().isEmpty() )
{
QDomElement wmsKeywordElem = doc.createElement( "KeywordList" );
QDomNodeList keywordList = keywordListElem.elementsByTagName( "value" );
for ( int i = 0; i < keywordList.size(); ++i )
if ( service.compare( "WMS", Qt::CaseInsensitive ) == 0 )
{
QDomElement keywordElem = doc.createElement( "Keyword" );
QDomText keywordText = doc.createTextNode( keywordList.at( i ).toElement().text() );
keywordElem.appendChild( keywordText );
if ( sia2045 )
QDomElement wmsKeywordElem = doc.createElement( "KeywordList" );
QDomNodeList keywordList = keywordListElem.elementsByTagName( "value" );
for ( int i = 0; i < keywordList.size(); ++i )
{
keywordElem.setAttribute( "vocabulary", "SIA_Geo405" );
QDomElement keywordElem = doc.createElement( "Keyword" );
QDomText keywordText = doc.createTextNode( keywordList.at( i ).toElement().text() );
keywordElem.appendChild( keywordText );
if ( sia2045 )
{
keywordElem.setAttribute( "vocabulary", "SIA_Geo405" );
}
wmsKeywordElem.appendChild( keywordElem );
}
wmsKeywordElem.appendChild( keywordElem );
}

if ( keywordList.size() > 0 )
if ( keywordList.size() > 0 )
{
serviceElem.appendChild( wmsKeywordElem );
}
}
else
{
QDomNodeList keywordNodeList = keywordListElem.elementsByTagName( "value" );
QStringList keywordList;
for ( int i = 0; i < keywordNodeList.size(); ++i )
{
keywordList.push_back( keywordNodeList.at( i ).toElement().text() );
}
QDomElement wmsKeywordElem = doc.createElement( "Keywords" );
if ( service.compare( "WCS", Qt::CaseInsensitive ) == 0 )
wmsKeywordElem = doc.createElement( "keywords" );
QDomText keywordText = doc.createTextNode( keywordList.join( ", " ) );
wmsKeywordElem.appendChild( keywordText );
serviceElem.appendChild( wmsKeywordElem );
}
}
@@ -1072,7 +1090,7 @@ QSet<QString> QgsServerProjectParser::findRestrictedLayers() const
}
}
}

// wmsLayerRestrictionValues contains LayerIDs
if ( mUseLayerIDs )
{

0 comments on commit 746af79

Please sign in to comment.
You can’t perform that action at this time.