Skip to content

shigekun/TileLayerPlugin

 
 

Repository files navigation

TileLayerPlugin

TileLayerPlugin is a plugin to add a web tile map as a layer onto your map canvas.

How to use?

TileLayerPlugin is under the Web menu. Only tile frame layers are listed in the add tile layer dialog until you add layer definitions by yourself. You can add available layers by writing a file in the format described below and setting the folder that the file exists as external layer definition directory. A list of prepared layer definition files is here.

A few layer styles can be changed in the layer properties dialog. You can set sufficient cache size (in kilobytes) in the Network/Cache Settings of the Options dialog in order to make effective use of cache.

Limitations

  • Can display only tile maps in the tile format of Slippy Map and similar web tile maps that y-axis of the tile matrix is inverted. Tile size should be 256 x 256.

Layer definition file format

Layer definition file is a text file. Each line has information for a tile layer. Fields are separated with tab character. The file extension is tsv and the file encoding is UTF-8.

Line format is:
title credit url yOriginTop zmin zmax xmin ymin xmax ymax

Description of fields:
Required

  • title: Layer title
  • credit: Credit (attribution) specified by tile map service provider.
  • url: Template URL of tile map. Special strings "{x}", "{y}" and "{z}" will be replaced with tile coordinates and zoom level that are calculated with current map view.

Options

  • yOriginTop: Origin location of tile matrix. 1 if origin is top-left (similar to Slippy Map), 0 if origin is bottom-left (similar to TMS). Default is 1.
  • zmin, zmax: Minimum/Maximum value of zoom level. Default values: zmin=0, zmax=18.
  • xmin, ymin, xmax, ymax: Layer extent in degrees (longitude/latitude). Note: Valid range of y in Pseudo Mercator projection is from about -85.05 to about 85.05.

Notes

  • You should correctly set zmin, zmax, xmin, ymin, xmax and ymax in order not to send unnecessary requests to tile map servers.
  • You SHOULD obey the Terms of Use of tile map service.

Examples of layer definition file

  • For a tile map provided by a HTTP server
    freetilemap.tsv
    RoadMap FreeTileMap http://freetilemap.example.com/road/{z}/{x}/{y}.png

  • For a tile map generated by gdal2tiles.py
    slope.tsv
    slope local file:///d:/tilemaps/slope/{z}/{x}/{y}.png 0 6 13 130.5 33.6 135.0 36.0

Note: Use tab character to separate fields!

ChangeLog

version 0.50-dev

  • Reprojection support

version 0.40

  • Moved to the web menu.
  • Moved settings to add layer dialog.
  • Default range of zoom level was changed to [0, 18].
  • Print quality improvement

version 0.30

  • Fixed "Could not draw" error that occurs in 64-bit QGIS (OSGeo4W64).
  • Adapted to multi-thread rendering.

version 0.20

  • Layer information file extension was limited to tsv.
  • providerName field was renamed to credit, and so on.

License

TileLayerPlugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Copyright (c) 2013 Minoru Akagi

About

[QGIS Plugin] add a web tile map as a layer onto your map canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published