Bug report #10470

QGIS-Server wrong legend generation if scale parameter is present

Added by aperi2007 - over 7 years ago. Updated over 7 years ago.

Assignee:Marco Hugentobler
Category:QGIS Server
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:18882

depositisuperficiali.zip - The QML with categorized rendering. (3.94 KB) aperi2007 -, 2014-06-12 08:57 AM


#1 Updated by aperi2007 - over 7 years ago

oops, the second was always with scale parameter.
this is really without scale parameter:


#2 Updated by Giovanni Manghi over 7 years ago

  • Category set to QGIS Server
  • Affected QGIS version changed from 2.2.0 to master

why blocker? it used to work in previous qgis releases?

#3 Updated by Marco Hugentobler over 7 years ago

  • Assignee set to Marco Hugentobler

#4 Updated by aperi2007 - over 7 years ago

I confirm it was also on QGIS 2.2 ,
but now is more badly.

Infact This is a sample from qgis-server 2.2:

QGIS 2.2 With scale parameter:

QGIS 2.2 without the scale parameter:

As yiu can see it break on the last domain.
So the user can effectlively see something , and all doamins are more or less visible.

in qgis 2.4 this is the situation:

QGIS 2.4 with scale parameter:

QGIS 2.4 without the scale parameter:

As you can see on QGIS 2.4 it lost fully two domains and a third is half.

So the QGIS 2.4 situation is worst than QGIS 2.2.

guess the Legend readability is an important question for a GIS system.
And I guess this is a worst question.

Of course this is only my opinion.

But effectively this is not a blocking question because as a workaround,
I could add two fake domains to be the last two values and invisibles (all white) to enlarge the image and retrieve so the two lost.



#5 Updated by Marco Hugentobler over 7 years ago

  • Status changed from Open to Feedback

What is the style of the layer (rule based renderer?), could you attach a .qml file?

#6 Updated by aperi2007 - over 7 years ago

Is a categorized rendering.

The QML of that image is quite complex because has a dual level rendering for every domains and with a point pattern inside using SVGs.
and also a data-definition use for rotation of patterns and also an expression controlled color border.

I will try to test and reproduce the bug on a more simple qml.

#7 Updated by aperi2007 - over 7 years ago


I confirm the problem is also with more simple qml.

This as example:
With the scale parameter the last domains are lost.


The qmls of this legend map is more simple than other and I can share the QML.
I attach it to this thread.



#8 Updated by Marco Hugentobler over 7 years ago

Ok, I imported the qml to my simple test project (layer does not match, but it does not matter for LegendGraphic). Issuing the example request (only map and layer params replaced), I get the full legend with and without scale parameter.

I've committed a fix for a crash about an hour ago. Are you also working with that version (d8a0361febf6a52cd47bfca8f753afbf2d0bd153) ? Though I cannot see how that fix would have any influence on the size of the generated image...

#9 Updated by aperi2007 - over 7 years ago

Yes I confirm.
I have update the server to the last updates truk and the ussue is disappeared.

Thx Marco,


#10 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Also available in: Atom PDF