Skip to content
Permalink
Browse files

Merge pull request #6251 from elpaso/bugfix-17975-server-layer-groups…

…-order

[bugfix][server] WMS respect order of grouped layers
  • Loading branch information
elpaso committed Feb 5, 2018
2 parents b6c2de4 + e3b054b commit 7bf0a7f7145d82ed07a565e01b171c129c20cf86
Showing with 16 additions and 3 deletions.
  1. +2 −2 src/server/services/wms/qgswmsrenderer.cpp
  2. +14 −1 tests/src/python/test_qgsserver_wms_getmap.py
@@ -2612,7 +2612,7 @@ namespace QgsWms
{
layer->readSld( namedElem, err );
layer->setCustomProperty( "readSLD", true );
layers.append( layer );
layers.insert( 0, layer );
}
}
}
@@ -2676,7 +2676,7 @@ namespace QgsWms
throw QgsMapServiceException( QStringLiteral( "StyleNotDefined" ), QStringLiteral( "Style \"%1\" does not exist for layer \"%2\"" ).arg( style, layerNickname( *layer ) ) );
}
}
layers.append( layer );
layers.insert( 0, layer );
}
}
}
@@ -890,12 +890,15 @@ def test_wms_getmap_sld(self):
self._img_diff_error(r, h, "WMS_GetMap_SLDRestored")

def test_wms_getmap_group(self):
"""A WMS shall render the requested layers by drawing the leftmost in the list
bottommost, the next one over that, and so on."""

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectGroupsPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetMap",
"LAYERS": "Country,Country_Labels,Country_Diagrams",
"LAYERS": "Country_Diagrams,Country_Labels,Country",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-16817707,-4710778,5696513,14587125",
@@ -921,6 +924,16 @@ def test_wms_getmap_group(self):
}.items())])

r_group, _ = self._result(self._execute_request(qs))

""" Debug check:
f = open('grouped.png', 'wb+')
f.write(r_group)
f.close()
f = open('individual.png', 'wb+')
f.write(r_individual)
f.close()
#"""

self.assertEqual(r_individual, r_group, 'Individual layers query and group layers query results should be identical')

qs = "?" + "&".join(["%s=%s" % i for i in list({

0 comments on commit 7bf0a7f

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