3

I just installed a tiles server in a VM following this tutorial, everything seems to work. I can see the image exemple on http://localhost/osm_tiles/0/0/0.png like it's supposed to be...

Now, I would like to "open" my tiles in QGIS, using WMS (or whatever) protocol.

I'm new in GIS and a bit lost about what I'm supposed to do.

So, I'm using CentOS 6.x, mod_tile, renderd, mapnik, osm2pgsql and a PostgreSQL/PostGIS database.

1

The TileLayerPlugin is designed for your workcase.

Available tilesets are defined in a TAB delimited text file.

The author offers this file for Openstreetmap tiles: https://gist.githubusercontent.com/minorua/78f619fca0dd21b97401/raw/36a413a1b173c2c5860752e003ee5009147a5805/OpenStreetMap.tsv

The file should be self-explaining, and can easily be expanded. My file looks like this:

Topo    Topo    file:///F:/Tiles/Topo/{z}/{x}/{y}.png   1   0   16  -180    -85.0   180.0   85.0
myMapnik    myMapnik    file:///F:/Tiles/myMapnik/{z}/{x}/{y}.png   1   0   15  -180    -85.0   180.0   85.0
WanderTopo  WanderTopo  file:///F:/Tiles/WanderTopo/{z}/{x}/{y}.png 1   0   15  -180    -85.0   180.0   85.0
PDA PDA file:///F:/Tiles/PDA/{z}/{x}/{y}.png    0   0   6   -180    -85.0   180.0   85.0
Google  Google  http://mt.google.com/vt/lyrs=s&x={x}&y={y}&z={z}    1   0   20  -180    -85.0   180.0   85.0
Openstreetmap   OSM http://c.tile.openstreetmap.org/{z}/{x}/{y}.png 1   0   19  -180    -85.0   180.0   85.0
lonviaHiking    lonvia  http://tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png  1   0   20  -180    -85.0   180.0   85.0
lonviaCycling   lonvia  http://tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png 1   0   20  -180    -85.0   180.0   85.0
Arcgis  Arcgis  http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}.png   1   0   16  -180    -85.0   180.0   85.0
Googlesv    Googlesv    https://mts1.googleapis.com/vt?hl=en-US&lyrs=svv|cb_client:apiv3&style=40,18&x={x}&y={y}&z={z}  1   0   20  -180    -85.0   180.0   85.0

Datasets can be folder structures on your disk, localhost, or any tile-serving web URL, as long as the tile naming scheme of OpenStreetMap is used.

  • When I try to fill "external layer definition directory" with my server URL nothing appears in the list... – Roozaay Aug 19 '16 at 12:33
  • That's not the intended use. By clicking on the 3-dot-icon, you can select a folder where the tab-separated file is placed. Default is C:\users\<username>\.qgis2\python\plugins\TileLayerPlugin\layers. You can take frame.tsv, and add a line inside with layer name, URL, zoom levels etc. – AndreJ Aug 19 '16 at 12:46
  • Okay, I'm supposed to edit frame.tsv ? how do I get the Title, Attribution, zoom, etc informations ? – Roozaay Aug 19 '16 at 12:58
  • Take the tsv file from the author linked above, open it with a good text editor like Notepad++, copy the last line, change the titel and attribution as you like and enter your URL where the OSM URL is. Instead of 0/0/0.png, the {z}/{x}/{y}.png should remain. Then put the tsv file next to the frame.tsv, or choose a different folder. – AndreJ Aug 19 '16 at 13:02
  • Okay I understand, I added "Test Test xx.xx.xx.xx/osm_tiles{z}/{x}/{y}.png" but nothing appeared EDIT: my bad, I forgot to add the x,y,z positions ! – Roozaay Aug 19 '16 at 13:11
3
  1. Install QuickMapServices Plugin (https://plugins.qgis.org/plugins/tags/qms/)
  2. Add your TMS source
  3. Enjoy

QMS settings

Add TMS Source

  • Thanks, it looks great ! I'll try that. Is there any solutions on the server side that can fit in my case ? Like sharing directly a WMS URL ? – Roozaay Aug 19 '16 at 8:04
  • QGIS supports WMS from the scratch. On server side you need some server software i.e. NextGIS Web, GeoServer, etc. I would like to note what WMS is not TMS. – Dmitry Baryshnikov Aug 19 '16 at 8:51
  • Thanks for your explanation, I just saw a mate who explained to me the difference too – Roozaay Aug 19 '16 at 9:24
  • FWIW, MapProxy is a good option if you want to support WMS given your pre-existing TMS. – alphabetasoup Aug 19 '16 at 11:36
  • @DmitryBaryshnikov what am I supposed to fill in the "ID" field ? – Roozaay Aug 19 '16 at 12:24

Your Answer

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

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