first WMTS layer does NOT choose the right resolution #19070
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Data Provider
Related to specific vector, raster or mesh data providers
Author Name: Richard Duivenvoorde (@rduivenvoorde)
Original Redmine Issue: 10671
Affected QGIS version: master
Redmine category:web_services_clients/wms
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)
The text was updated successfully, but these errors were encountered: