Bug report #3753

"Zoom to best scale" takes a long time (inf?) for TMS layers.

Added by Borys Jurgiel about 13 years ago. Updated about 13 years ago.

Assignee:Redmine Admin
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:invalid
Crashes QGIS or corrupts data: Copied to github as #:13812


Not long ago the Zoom To Best Scale was working fine with TMS layers (and was an important feature, allowing to synchronize the zoom with available tile levels). Last days it seems to take infinite time, hanging qgis.

ola.xml Magnifier - sample TMS source definition (637 Bytes) Borys Jurgiel, 2011-04-17 12:19 PM


#1 Updated by Redmine Admin about 13 years ago

I tried with both current trunk and pre raster providers branch merge 5bae2abe (SVN r15392) and both work the same way, it takes some time and then gives GDAL error

ERROR 1: GDALWMS: Unable to download block 262143, 262143.
  URL: http://tile.openstreetmap.org/19/262143/262143.png
  HTTP status code: 404, error: (null).
ERROR 1: IReadBlock failed at X offset 262143, Y offset 262143
ERROR 1: [[GetBlockRef]] failed at X block offset 262143, Y block offset 262143
Warning: [[RasterIO]] error: [[GetBlockRef]] failed at X block offset 262143, Y block offset 262143

and zooms to very high resolution.

What do you mean by "synchronize the zoom with available tile levels"? Aren't you mixing with Openlayers?

#2 Updated by Borys Jurgiel about 13 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

Ok, I've checked it twice and the ticket was invalid. Sorry. The problem was in the xml file.

The "zoom to best scale" zooms to the zoom level defined in the <TileLevel> tag in the xml file. It was set to 19, while the OSM TMS supports zoom levels up to 18. If you set that tag to 18, everything works ok.

About the "synchronization". The OpenLayers layer, as well as WMS-C one, fixes the scale series to available zoom levels, so it works OOTB and it's fine. With the gdal minidriver, the scale is contnous, so the user has to take care of it and keep it always 1:2257, 1:4514, 1:9028 etc. Otherwise the image is ugly rescaled. There simplest way to keep the scale always corresponding to the avilable zoom levels is to use the "zoom to best scale" and then only use "zoom in" and "zoom out" to keep the 2x factor. I hope I'm clear this time :)

Also available in: Atom PDF