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

Martin Dobias wonder.sk at gmail.com
Wed Feb 27 02:23:45 PST 2019


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

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.


> I have a vague feeling that Sourcepole's albiero fork implemented
> something similar to this... some possibly related commits are
>
> https://github.com/sourcepole/kadas-albireo/commit/09bb1c82f296f736ce8ecc07f03b03fc5861ddd3
> https://github.com/sourcepole/kadas-albireo/commit/09a4cb0bac5fe8a6c2563f811171804044c60d65

Thanks for the pointer to those commits! There seems to be a mix of
behaviors with somewhat arbitrary threshold of 225 DPI (I guess
assuming screens are < 225 while printing uses > 225). If I read the
code correctly, for screens it would not apply any scaling, but for
print it would scale tiles up. Not sure why the logic is designed this
way...

Cheers
Martin


More information about the QGIS-Developer mailing list