qgis/qwc2-demo-app

Routing plugin: Symbology of routes and reachability areas map viewer vs print/export

Closed this issue · 7 comments

I discovered, that the symbology of routes and reachability areas created with the routing plugin differs within the map view compared to the version which is printed/exported as image. As the color is hard coded with rgb(10, 10, 255) within the plugin, the style which is used for export is a different one (I don't get, where it comes from). Moreover the route itself is missing within the export (the way points are printed).

Routing:
grafik
grafik

Reachability:
grafik
grafik

It would be nice to get the route printed aswell and furthermore the same symbology for the way points, routing lines and area polygons and used font family of the labels within the map and print/export.

The mismatching geometry style should be fixed by [1]. Regarding the markers, the problem is that the marker symbol is not available to the server resp QGIS Server currently does not appear to correctly handle references to images in the SLD symbology.

[1] qgis/qwc2@682113a

Ok, I see. Thanks for the fix for the mismatching geometry styles! But is there a chance to consider the font family of the label in the map viewer aswell?

Not via request, the redlining request parameters do not allow you to specify the font family [1]. What could/should work is setting the default font family in the QGIS Server environment.

[1] https://docs.qgis.org/3.16/en/docs/server_manual/services.html#redlining

Just one thing:
What do you think about another config parameter extraRedliningParameters for the redlining plugin? As within the MapLegend plugin [1] this could give the user the possibility to define standards for the HIGHLIGHT parameters of the QGIS Server [2] which should then be considered in GetMap and GetPrint request.

[1] https://qwc-services.github.io/master/references/qwc2_plugins/#maplegend
[2] https://docs.qgis.org/3.34/en/docs/server_manual/services/wms.html#redlining

This would need to be specified in more detail, the highlight parameters are per feature, you cannot really define a global set of parameters to just append to the request.

uh, I see, thanks for clarification.

I just came across this again ...

Just for my understanding: Could you please clearify, why this is working with the routing labels and not the redlining labels?

The labels of the routing way points are using the same font family within the map view and in the result of GetMap requests of the MapExport plugin and GetPrint requests of the Print plugin:

map viewer:
grafik

map export:
grafik

So what font family is this and where does it come from?

With the redlining it looks like this:

map view:
grafik

map export:
grafik
This is how it looks before with the routing labels, too. I think Dejavu font is used here.

as you mentioned, it has to be specified in more detail, as the font family (and other highlight parameters) could be defined per feature. But wouldn't it be a better way to specify something which is the same for alle features than nothing?

What I have in my mind:
specify the parameter within the plugin config:
highlight_labelfont: Arial

do a search replace within the request, for instance at this position:
HIGHLIGHT_LABELSTRING -> HIGHLIGHT_LABELFONT=<highlight_labelfont>&HIGHLIGHT_LABELSTRING

For more than one feature maybe it's possible to count the %3B of HIGHLIGHT_LABELSTRING and adding respective HIGHLIGHT_LABELFONT=<highlight_labelfont>%3B<highlight_labelfont>.

Would this be an option?

Unfortunately I couldn't find an option to pass the default font family to QGIS Server via ENV, I think, this case isn't covered there ...