Skip to content
Permalink
Browse files

Merge pull request #6867 from pblottiere/bugfix_nobbox

[server] CRS position in GetCapabilities document
  • Loading branch information
rldhont committed May 2, 2018
2 parents f019bc0 + 1afe0d1 commit 956d669304065df1f2c8cdc74ac4d243d9e7f67f
@@ -1205,6 +1205,13 @@ namespace QgsWms
QDomElement abstractElement = layerElement.firstChildElement( QStringLiteral( "Abstract" ) );
QDomElement CRSPrecedingElement = abstractElement.isNull() ? titleElement : abstractElement; //last element before the CRS elements

if ( CRSPrecedingElement.isNull() )
{
// keyword list element is never empty
const QDomElement keyElement = layerElement.firstChildElement( QStringLiteral( "KeywordList" ) );
CRSPrecedingElement = keyElement;
}

//In case the number of advertised CRS is constrained
if ( !constrainedCrsList.isEmpty() )
{
@@ -146,6 +146,23 @@ def test_project_wms_inspire(self):
for request in ('GetCapabilities',):
self.wms_inspire_request_compare(request)

def test_wms_getcapabilities_without_title(self):
# Empty title in project leads to a Layer element without Name, Title
# and Abstract tags. However, it should still have a CRS and a BBOX
# according to OGC specifications tests.
project = os.path.join(self.testdata_path, "test_project_without_title.qgs")
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(project),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetCapabilities",
"STYLES": ""
}.items())])

r, h = self._result(self._execute_request(qs))

self.wms_request_compare('GetCapabilities', reference_file='wms_getcapabilities_without_title', project='test_project_without_title.qgs')

def test_wms_getcapabilities_url(self):
# empty url in project
project = os.path.join(self.testdata_path, "test_project_without_urls.qgs")

0 comments on commit 956d669

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