[QGIS-Developer] WMTS/XYZ on high DPI screens

Matthias Kuhn matthias at opengis.ch
Wed Feb 27 04:03:48 PST 2019


HI Martin

On 2/27/19 11:23 AM, Martin Dobias wrote:
> Hi Nyall
>
> On Wed, Feb 27, 2019 at 4:40 AM Nyall Dawson <nyall.dawson at gmail.com> wrote:
>> So I'm guessing this setting would apply in print layouts too?
>> Regardless of the output resolution, it would be exported as though
>> it's at 96 dpi?
> Yes, that's correct - print output would be affected too. That means
> that tiles from a regular XYZ service would be scaled up. Now this is
> something I am not 100% sure about how this should work. On one hand
> scaling tiles up is useful with tile layers containing labels (they
> will have the same size as on the screen), on the other hand for some
> tiles this may not be desired (scaling them up would just reduce their
> resolution).
>
> I am wondering if we should have three options for tile resolutions:
> - standard (96 DPI) ... autoscaled, for 256x256 tiles for XYZ tiles
> - high res (192 DPI) ... autoscaled, for 512x512 tiles for XYZ tiles
> - undefined ... not scaled

Sounds reasonable.

I can see the following options for what a data provider can offer:

  * A predefined set of available DPI from the server (e.g. XYZ)

  * Manually specify DPI (e.g. as WMS parameter "DPI=300")

  * No scaling available

Some dataproviders might know what they can offer (WMS might include
that in the GetCapabilities, AFS maybe?), others might need
configuration on layer / data provider properties (XYZ, preconfigured
through QMS or ,qml/.qlr files).


I assume that it's also not always desired to get the maximum resolution.

E.g. in HighRes atlas printing a WMS via a network connection with
"DPI=3000" parameter could be very slow, so the API should be prepared
to specify

 * "data source DPI", i.e. what's requested from the provider

 * and output device DPI, i.e. what it's scaled to for screen/paper

> This should hopefully handle all the cases. I am not sure though which
> option should be the default. For compatibility reasons (not to break
> existing behavior of QGIS) probably it would be good to have
> "undefined" as the default with no scaling of tiles on screen nor for
> print. Only when deliberately switched to standard / high res
> resolution we would apply scaling.

Yes, that sounds like the safest approach.

Matthias



More information about the QGIS-Developer mailing list