I’m using QGIS 2.14.9 (upgrading is not an option), and QuickMapServices. I have two tile servers (one for images and one for OSM). Images work, OSM does not. I'm sure the problem is related to whether the tile pyramid is square or not.

The image server serves a square pyramid and works fine in QMS. By "square", I mean the lowest resolution zoom has a single tile, the next-lowest has 2x2 tiles, etc.

But tiles from the OSM server are drawn in the wrong place, scaled by a factor of two somehow, because the OSM server uses a rectangular pyramid with a 2:1 aspect. The lowest resolution has two tiles, the next-lowest has 4x2 tiles, etc. I don't know whether this is unusual- it does make sense, since it's 360 degrees around the earth longitudinally and only 180 pole-to-pole- but I don't see how to make it work in QMS. It's not a public server so I can't point you to it.

I'm actually writing a standalone app, using the TileLayer class in QMS, so I do have the ability to pass in the tile_ranges parameter to TileLayer. Without doing that, I only get the western hemisphere. If I pass in tile_ranges with a 2:1 aspect, I get both hemispheres, but the scaling is still wrong.

I suspect I'll need to modify one of TileLayer's drawTiles methods.

  • I don't understand your question. OSM tiles are 1:1 squares. What's your problem? – bugmenot123 May 29 '19 at 10:37
  • Tiles are square; the issue is non-square pyramids. I've edit the title slightly to clarify. – mark78 May 31 '19 at 2:05
  • Maybe I should ask this way. Of the many public tile servers, is it common to have non-square pyramids (where the lowest resolution zoom has 2x1 tiles)? Or are they always square (so the lowest resolution zoom has exactly one tile)? – mark78 May 31 '19 at 2:09
  • I have never encountered a non square tile server, that would defeat the purpose. – bugmenot123 May 31 '19 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.