From a898ff28075d7a3d72a01f789d8327bc362e4c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 29 Feb 2020 20:11:49 +0100 Subject: [PATCH] Use 72dpi in the ScaleHint to scaleDenominator transformation --- src/map/wms.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map/wms.cpp b/src/map/wms.cpp index 0567f908..fa17124f 100644 --- a/src/map/wms.cpp +++ b/src/map/wms.cpp @@ -10,7 +10,10 @@ static inline double hint2denominator(double h) { - return sqrt((h * h) / 2.0) / 0.28e-3; + /* Some WMS 1.1.1 servers use a 72dpi resolution by default. Using the usual + 90dpi (0.28mm) resolution known from later standards (WMS 1.3, WMTS) does + make them return emty images in the "max" scale level. */ + return h / (M_SQRT2 * 0.36e-3); } WMS::CTX::CTX(const Setup &setup) : setup(setup), formatSupported(false)