[QGIS-Developer] two issues in QGIS (Server and print composer) 2.18.10(?)

Nyall Dawson nyall.dawson at gmail.com
Thu Jul 20 15:26:53 PDT 2017


On 21 July 2017 at 02:23, Giovanni Manghi <giovanni.manghi at gmail.com> wrote:
> On Thu, Jul 20, 2017 at 5:01 PM,
> <qgis-developer-request at lists.osgeo.org> wrote:
>> Send QGIS-Developer mailing list submissions to
>>         qgis-developer at lists.osgeo.org
>
>>    5. two issues in QGIS (Server and print composer)    2.18.10(?)
>>       (Giovanni Manghi)
>
>
>> 2) was the option "none" for the "map" option of a legend object in
>> print composer removed on purpose from 2.18(.10)? I still see it in
>> 2.14.16 and it was *very important* to get "fixed" legends -via
>> GetPrint- in QGIS Server. If it was removed by design I suppose there
>> is another way to achieve that in 2.18... some can point me to it? If
>> the option was just removed and I'm not missing anything then now via
>> GetPrint is not possible to have layouts printed with "fixed" legends
>> (the layer name appears, not its symbology class/es).
>>
>> see the following two examples.
>>
>> The first is the result of a getprint from a project saved within 2.14
>> where the legend option "map" was set to "none"
>>
>> https://www.dropbox.com/s/f1jtr2i8qfbm5sw/qgis_server_with_none_option.pdf?dl=0
>>
>> The second is the result of a getprint from a project saved within
>> 2.18 where the legend option "map" was set to "map0" because there is
>> no "none" option (or within 2.14 setting always the option to "map0")
>>
>> https://www.dropbox.com/s/svgbmx8sor7jjuz/qgis_server_without_none_option.pdf?dl=0
>>
>> both requests were made via QGIS Server 2.18 using a project with
>> several layers but actually only one was added in the request (using
>> Lizmap demo project here if anyone is interested):
>>
>> http://localhost/cgi-bin/qgis_mapserv.fcgi?map=/path/to/my/project.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetPrint&FORMAT=pdf&TRANSPARENT=true&SRS=EPSG:3857&DPI=100&TEMPLATE=Landscape%20A4&map0:extent=420232.0463583274,5395327.438198717,443932.6162906727,5414427.897511283&map0:scale=100000&map0:LAYERS=points%20of%20interest&LAYERS=points%20of%20interest
>>
>
>
>
> actually the result of the GetPrint (with the above request) when the
> project is saved in 2.18 is this one
>
> https://www.dropbox.com/s/hfsvul4uy3h5uqa/qgis_server_without_none_option_2_18.pdf?dl=0
>
> and the legend shows "?" in place of layer names (see above). So I
> really think this is a regression possibly caused by the removal of
> this "none" option.
>
>
> I would appreciate if any QGIS Server/map composer dev can chime in here.

It'll be https://github.com/qgis/QGIS/commit/1b4bd47076103e931e642c9c2b6a363f14b20a45
which removed the None option.

...HOWEVER...

I'm having a lot of trouble trying to understand what the correct
server logic is here. Is it:

- if a getprint request is made without any layers specified then all
layers are shown in both the map and legend
- if layers are specified then:
  - legend set to a map: ONLY those layers should be shown in the map and legend
  - legend set to None: only shown those layers in the map, but
EVERYTHING in the legend
?

If so, I'd say that's unpredictable, opaque behavior and needs to be
fixed in the UI.

Possible options would be:

1. adding a server settings section to the legend properties, with a
checkbox "always show all layers (Regardless of requested layers)" (or
betterly worded!)

2. Taking advantage of the existing "filter legend by map" option to
handle this use case (which should already be supported in 2.x - it
just needs that setting switched on in your projects). The only
downside here is that if a layer is requested but has no features
visible in the extent then it won't be shown in the legend. (That's
arguably the correct cartographic behaviour though!)

I don't think the "none" option should be brought back, as it makes
legend behaviour unpredictable in itself. E.g. what scale should the
legend use for symbols with map unit sizes? What preset style should
it use?

Nyall







>
> cheers
>
> -- G --
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list