1

How do I add cartodb_voyager as a basemap to QGIS and Mapinfo? The map can be found here: https://leaflet-extras.github.io/leaflet-providers/preview/#filter=CartoDB.Voyager

I am using qgis v3.2 so some of the addons which would presumably add it have not been updated yet. I am using mapinfo v16 as well.

3

In the preview, you can see JavaScript code. QGIS uses Python, so we can't just use this code snippet to load the layer into QGIS. enter image description here From reading the code, we learn that this layer is a tile layer (1). Highlight and copy the service URL (2). Use this URL to load the basemap as an XYZ tile layer in QGIS. (3) Also note that the maximum zoom level should be 19.

Now, here's where it got a bit tricky. The URL from the preview JavaScript snippet doesn't work. Fortunately, I already had a few CartoDB XYZ tile layers in my browser. I compared the URL for the Voyager layer with the URL for another CartoDB layer, and found that they have different root URLs. So I took the end of the Voyager layer link, and combined it with the root URL from a functioning layer.

Here's the non-functioning link for the Voyager layer from the JavaScript in the preview:

https://cartodb-basemaps-{s}.global.ssl.fastly.net/rastertiles/voyager/{z}/{x}/{y}{r}.png

Here's a functional link for a different CartoDB layer:

http://basemaps.cartocdn.com/light_all/%7Bz%7D/%7Bx%7D/%7By%7D.png

And here's the functional link for the CartoDB Voyager layer:

http://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png

Add basemap as XYZ Tile layer in QGIS

In Browser panel, right-click on XYZ Tiles and select "New Connection"

enter image description here

Enter layer name and service URL. Change max zoom level to 19. Click OK.

Now you have the CartoDB Voyager layer in your browser. Double-click on the layer name in the Browser panel to add it to your project.

enter image description here


Thanks to @JonathanWest for contributing this information:

According to github.com/CartoDB/basemap-styles - The structure of the URLs to call the service is the following: https://{s}.basemaps.cartocdn.com/{style}/{z}/{x}/{y}{scale}.png, where:

  • {s}: one of the available subdomains, either [a,b,c,d]
  • {z}: Zoom level. We support from 0 to 20 zoom levels in OSM tiling system.
  • {x},{y}: Tile coordinates in OSM tiling system
  • {scale}: OPTIONAL "@2x" for double resolution tiles
  • {style}: Map style, possible value is one of:
    • light_all,
    • dark_all,
    • light_nolabels,
    • light_only_labels,
    • dark_nolabels,
    • dark_only_labels,
    • rastertiles/voyager,
    • rastertiles/voyager_nolabels,
    • rastertiles/voyager_only_labels,
    • rastertiles/voyager_labels_under
  • 1
    Thank you very much! You are correct and that does work in QGIS. I'd also like to add for further users that according to github.com/CartoDB/basemap-styles - The structure of the URLs to call the service is the following: https://{s}.basemaps.cartocdn.com/{style}/{z}/{x}/{y}{scale}.png , where: • {s}: one of the available subdomains, either [a,b,c,d] • {z} : Zoom level. We support from 0 to 20 zoom levels in OSM tiling system. • {x},{y}: Tile coordinates in OSM tiling system • {scale}: OPTIONAL "@2x" for double resolution tiles • {style}: Map style, possible value is one of: – Jonathan West Jul 25 '18 at 8:24
  • @JonathanWest Thank you for that note, it's very helpful. I'm adding it to my answer so it's easier to see. – csk Jul 25 '18 at 18:07
0

Open up the browser panel in QGIS.

Scroll down to "XYZ Tiles".

Right click on it and choose "New Connection".

Add in the tile server URL:

https://cartodb-basemaps-1.global.ssl.fastly.net/rastertiles/voyager/{z}/{x}/{y}{r}.png

Give it a name. Click OK. Now double click on it to add it to QGIS.

0

If you want to create a Tile Server table for MapInfo Pro, you can use this Create Table statement via the MapBasic window.

The statement will look like this:

Create Table Carto_Voyager
   File "C:\Carto Voyager.tab"
   Type TILESERVER 
   TileType "LevelRowColumn" 
   URL "https://cartodb-basemaps-1.global.ssl.fastly.net/rastertiles/voyager/{LEVEL}/{ROW}/{COL}.png" 
   AttributionText "Carto Voyager" Font("Arial",255,16,0,255) 
   MinLevel 0 MaxLevel 20 Height 256 
   CoordSys Earth Projection 10, 157, 7, 0 Bounds(-20037508.34,-20037508.34) (20037508.34,20037508.34)

You might want to check the URL as I haven't compared it to the structure mention in the answer by CSK

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.