Sunday, 2 June 2019

Open local TMS in QGIS using gdal


I created a TMS using gdal2tiles command. The tiles where generated correctly and I can see them using the leaflet and openlayers html pages also created by gdal2tiles. Now, I'm trying to open the TMS in QGIS, using gdal and the TMS mini driver.



I created the xml file describing the TMS but when I load it in QGIS, I get a blank screen with some random colored pixels on the top part of the screen. Any Idea what could be wrong? I'm using QGIS 2.18.0, 64bis from OsGeo4W (windows 10).


Bellow is my XML file:




./${z}/${x}/${y}.png
image/png


-20037508.34
20037508.34

20037508.34
-20037508.34
14
1
1
top

EPSG:3857
256
256

4
byte
204,303,400,404,500,501
true



Answer



It might be necessary to add a protocol (http://localhost/ or file:///) to the serviceURL. See GDAL TMS (WMS) mini driver for an example.


As an alternative, you can use the TileLayer plugin, which can deal with local tiles with this syntax:


 myMapnik   myMapnik    file:///F:/Tiles/myMapnik/{z}/{x}/{y}.png   1   0   15  -180    -85.0   180.0   85.0


The plugin expects a file with TAB delimiters.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...