I just learned that QGIS 2.18 has a Tile Server (XYZ) provider in the Browser Panel. I created a large tile map using gdal2tiles and I'm trying to load it. However, I'm not publishing the tiles through a web server instead, I though about reading the files strait from the disk. So, in the Tile Server url I used file:///I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png. The tiles do not load and I see the following error in the log panel: Tile request max retry error. Failed 3 requests for tile 13 of tileRequest 2 (url: file:///I/SUL/rapid_tms_utm21/6/19/38.png).

So, the questions are:

  1. Does QGIS Tile Server provider works with local files?
  2. Can I use the file:/// protocol? How?

I tried the following lines as the TMS Server address:

  • file:///I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • file:///I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • /I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • /I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • file://I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
  • file://I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png

And the tiles work using the TileLayerPlugin

  • It does not works for me with file:///F:/Tiles/Topo/{z}/{x}/{y}.png, but using the WM(t)S.xml file it does.
    – AndreJ
    Commented Nov 25, 2016 at 16:29
  • 3
    ... and works with a local Apache server from ms4w, targetting to the tiles root folder.
    – AndreJ
    Commented Nov 25, 2016 at 16:52
  • @AndreJ So if I correctly create the GetCapabilties.xml file and place it in the top level of the tile files hierarchy, QGIS will correctly access those tiles off disk as if they were being served by an actual tile server application?
    – Joebocop
    Commented Feb 16, 2018 at 18:48
  • 1
    @Joebocop you can try on your own, I had no success without an Apache server. The TileLayerPlugin works for me without the Apache server (unless you zoom in and out heavily github.com/minorua/TileLayerPlugin/issues/29 ), but I don't know if it will be continued in QGIS 3.
    – AndreJ
    Commented Feb 17, 2018 at 10:32
  • See issue #35 on GitHub. Unfortunately, TileLayer (and hence the seamless integration of local {z}/{x}/{y} tiles) is currently not on schedule for QGIS 3.
    – fdetsch
    Commented Mar 14, 2018 at 7:53

3 Answers 3


For use of a local Apache Server from the ms4w package, I installed MS4w into C:\ms4w\ and stored the tiles folder structure beneath C:\Tiles\.

Then I edited the file C:\ms4w\Apache\conf around line 252 to change the DocumentRoot to:

DocumentRoot "C:/Tiles"
<Directory "C:/Tiles">

Tiles can then be accessed by something like http://localhost/{z}/{x}/{y}.png

This is rather a dirty hack, but works for me.


@daniel You need to specify the tiles path exactly as follow :

file:///I://SUL//rapid_tms_utm21//sat//{z}//{x}//{y}.png <--

This is working for QGIS 3 as well.

  • The path of my drive is like "D:\sasplanet\cache\sat\z7\0\x28\0\y24.jpg" and I added the path in XYZ connection as "file:///D://sasplanet//cache//sat//z{z}//{x}//{y}.jpg" but noting displays.
    – Sachin
    Commented Jun 22, 2019 at 7:58
  • You need to edit SAS.PLANET Configuration : | 1 : Click on Settings>Options> | 2 : Default cache type : GlobalMapper Tiles | 3 : GlobalMapper Tiles (GMT) cache folder: cache_gmt Good Luck Commented Jun 22, 2019 at 8:21
  • refer to my answer here for more detail : gis.stackexchange.com/questions/326125/… Commented Jun 22, 2019 at 8:23
  • 1
    then @sachin-kumar use path in XYZ connection as file:///D://Software//SAS.Planet//cache_gmt//sat//z{z}//{y}//{x}.jpg Commented Jun 22, 2019 at 8:36
  • 1
    QGIS 3.32. Don't work
    – Rudzik
    Commented Oct 26, 2023 at 16:36

The answer of @Ilyes worked for me, I only had to add a "-" sign to the y because the tiling wasn't correct


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.