Bug report #10671

first WMTS layer does NOT choose the right resolution

Added by Richard Duivenvoorde over 10 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WMS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:19070

Description

If I add a wmts layer to an empty project, it is always blurry (with or without tilescale).

test eg in python console:

iface.addRasterLayer("tileMatrixSet=EPSG:28992&crs=EPSG:28992&layers=brtachtergrondkaart&styles=&format=image/png&url=http://geodata.nationaalgeoregister.nl/wmts?VERSION%3D1.0.0%26request%3DGetCapabilities","wmts master example","wms")

selecting that layer the and the following python show the resolutions:

iface.mapCanvas().currentLayer().dataProvider().property("resolutions")
[0.21, 0.42, 0.84, 1.68, 3.36, 6.72, 13.44, 26.88, 53.76, 107.52, 215.04, 430.08, 860.16, 1720.32, 3440.64]

looking into the code at:

https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp#L576

it looks like the provider is searching for the best fit resolution, but it's not clear to me why that does not succeed.

IF I have to choose between fitting the max extent in the window OR having maybe a little cut off extent but in a sharp resolution, I would go for the latter case.

I would be great that if you add a wmts (often an opaque reference layer) as first layer that it is in the right resolution. Also because after that it will never reach the 'sharp' looking resolutions anymore (inless you fiddle with the tile scale etc).

(I tried to debug, but I loose track in the logic of that part (vres pres?) that part)

History

#1 Updated by Nyall Dawson over 10 years ago

I can confirm this - steps to reproduce:

1. add the WMTS with url http://api.maps.vic.gov.au/geowebcacheWM/service/wms?version=1.1.1&tiled=true
2. choose the "web mercator" layer
3. add the layer to a map
4. right click the layer and select "zoom to best scale" - scale chosen results in blocky, resampled map

#2 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#3 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF