QGIS – How to Display and Open Local TMS with QGIS

qgistile-map-service

I want to display the content of a local TMS (a tile map, stored in a directory structure Z/X/Y.png) in QGIS.

This is for quick check and comparison.
I am not willing to set WMTS webserver for this purpose.

I tried to load this kind of file in QGIS but I got only a white or stripped map

  <GDAL_WMS>
  <Service name="TMS">
    <ServerUrl>file:///vdata/myTMS/${z}/${x}/${y}.png</ServerUrl>
     <Format>png</Format>
     <Transparent>TRUE</Transparent>
  </Service>
  <DataWindow>
    <UpperLeftX>-20037508.34</UpperLeftX>
    <UpperLeftY>20037508.34</UpperLeftY>
    <LowerRightX>20037508.34</LowerRightX>
    <LowerRightY>-20037508.34</LowerRightY>
    <TileLevel>11</TileLevel>
    <TileCountX>1</TileCountX>
    <TileCountY>1</TileCountY>
    <YOrigin>bottom</YOrigin>
  </DataWindow>
  <Projection>EPSG:3857</Projection>
  <BlockSizeX>256</BlockSizeX>
  <BlockSizeY>256</BlockSizeY>
   <BandsCount>4</BandsCount>   
 </GDAL_WMS>    

I am running QGIS 2.14

Best Answer

Works directly at least in QGIS 3.6+ (likely some previous versions as well):

  • In the content browser, right-click on "XYZ Tiles" and select "New connection..."
  • Specify a name and for the URL, use file:///$PATH/{z}/{x}/{y}.png which points to your local tiles

Hope this helps -- Alex

Related Question