Vector Tiles light basemap: wrong style URL

299 views
Skip to first unread message

Daniel Ursprung

unread,
Mar 28, 2022, 6:33:31 AM3/28/22
to GeoAdminCh API
I have problems loading light Basemap using Vector Tiles Service. A few months ago, I successfully created a new Vector Tile Connection in QGIS with the following information:

URL (to load tiles):  
https://vectortiles14.geo.admin.ch/mbtiles/ch.swisstopo.leichte-basiskarte.vt/v006/{z}/{x}/{y}.pbf  
 
Style-URL (to load style):  
http://vectortiles.geo.admin.ch/gl-styles/ch.swisstopo.leichte-basiskarte.vt/v006/style.json

This does not work any more. I checked the Swisstopo Website, but was not able to find a working URL:
https://www.geo.admin.ch/de/geo-dienstleistungen/geodienste/darstellungsdienste-webmapping-webgis-anwendungen/vector_tiles_service.html#verf%C3%BCgbar

The URL for the vector tiles seems to be correct: I am able to load the tiles with an alternative syle URL:
https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v1.0.0/tiles.json

But the style is not correct, see screenshot here:
https://www.daniel-ursprung.ch/vectortiles.png

Can anyone help getting the URL for a/the correct style ?

David...@swisstopo.ch

unread,
Mar 28, 2022, 7:14:53 AM3/28/22
to geoadm...@googlegroups.com

You are using an outdated old Version: Version 1.0.0  as shown in https://api3.geo.admin.ch/services/sdiservices.html#id45 is up to date

An how to for QGIS:

https://github.com/cividi/geohackmin/discussions/48

--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/bc27f7b5-97b3-4f14-af2c-7196a9b97f01n%40googlegroups.com.

Daniel Ursprung

unread,
Mar 28, 2022, 4:29:52 PM3/28/22
to GeoAdminCh API
OK, great, that works, thanks a lot. However, the first site you linked to does not mention the correct tiles URL: https://vectortiles10.geo.admin.ch/.... , it has https://vectortiles.geo.admin.ch/... So do I miss something or does the correct link lack on the Swisstopo Website?

David...@swisstopo.ch

unread,
Mar 29, 2022, 1:30:04 AM3/29/22
to geoadm...@googlegroups.com
vectortiles.geo.admin.ch Is correct
The other URLs are aliases - and are used in http acceleration context…

________________________________

Von: Daniel Ursprung <da...@access.uzh.ch>
Datum: 28. März 2022 um 22:30:01 MESZ
An: GeoAdminCh API <geoadm...@googlegroups.com>
Betreff: Re: Vector Tiles light basemap: wrong style URL

OK, great, that works, thanks a lot. However, the first site you linked to does not mention the correct tiles URL: https://vectortiles10.geo.admin.ch/.... , it has https://vectortiles.geo.admin.ch/... So do I miss something or does the correct link lack on the Swisstopo Website?

David...@swisstopo.ch schrieb am Montag, 28. März 2022 um 13:14:53 UTC+2:
You are using an outdated old Version: Version 1.0.0 as shown in https://api3.geo.admin.ch/services/sdiservices.html#id45 is up to date
An how to for QGIS:
https://github.com/cividi/geohackmin/discussions/48


Von: geoadm...@googlegroups.com <geoadm...@googlegroups.com> Im Auftrag von Daniel Ursprung
Gesendet: Montag, 28. März 2022 12:34
An: GeoAdminCh API <geoadm...@googlegroups.com>
Betreff: Vector Tiles light basemap: wrong style URL

I have problems loading light Basemap using Vector Tiles Service. A few months ago, I successfully created a new Vector Tile Connection in QGIS with the following information:

URL (to load tiles):
https://vectortiles14.geo.admin.ch/mbtiles/ch.swisstopo.leichte-basiskarte.vt/v006/{z}/{x}/{y}.pbf<https://vectortiles14.geo.admin.ch/mbtiles/ch.swisstopo.leichte-basiskarte.vt/v006/%7bz%7d/%7bx%7d/%7by%7d.pbf>

Style-URL (to load style):
http://vectortiles.geo.admin.ch/gl-styles/ch.swisstopo.leichte-basiskarte.vt/v006/style.json

This does not work any more. I checked the Swisstopo Website, but was not able to find a working URL:
https://www.geo.admin.ch/de/geo-dienstleistungen/geodienste/darstellungsdienste-webmapping-webgis-anwendungen/vector_tiles_service.html#verf%C3%BCgbar

The URL for the vector tiles seems to be correct: I am able to load the tiles with an alternative syle URL:
https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v1.0.0/tiles.json

But the style is not correct, see screenshot here:
https://www.daniel-ursprung.ch/vectortiles.png

Can anyone help getting the URL for a/the correct style ?
--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/bc27f7b5-97b3-4f14-af2c-7196a9b97f01n%40googlegroups.com<https://groups.google.com/d/msgid/geoadmin-api/bc27f7b5-97b3-4f14-af2c-7196a9b97f01n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com<mailto:geoadmin-api...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/6358e6a5-fe7a-45ee-8a26-7e430119a497n%40googlegroups.com<https://groups.google.com/d/msgid/geoadmin-api/6358e6a5-fe7a-45ee-8a26-7e430119a497n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Daniel Ursprung

unread,
Jun 28, 2022, 5:14:37 PM6/28/22
to GeoAdminCh API

Sorry, I again have the same problem. I can't load Leichte Basiskarte in QGIS 3.26. I can't find the correct URL for pbf and style, I always get an error message. In the links to the Swisstopo Website, there are a lot of URL's, however I'm not sure which one to use and why this URL seems to change so often.

David Oesch

unread,
Jun 29, 2022, 12:15:21 AM6/29/22
to geoadm...@googlegroups.com
Hi 

Following The steps in 
Can you post here the error you get in which specific step ?

Daniel Ursprung

unread,
Jul 6, 2022, 11:06:26 AM7/6/22
to GeoAdminCh API

Yes, I created a VectorTile connection with the URL's as described in the description you linked. Still, loading the vecotr tiles, I get an error message and the tiels do not load at all, see screenshot: https://drive.switch.ch/index.php/s/wZmnGqrk83DbQig

The first few lines of the error message read as follows:

The following warnings were generated while converting the vector tile style:

  • aerialway: Could not set opacity of layer, opacity already defined in stroke color
  • aerodrome_label: Could not retrieve sprite ''
  • aerodrome_label: Referenced font Frutiger Neue Condensed Regular is not available on system
  • area_name_glacier_line_label: Referenced font Frutiger Neue Italic is not available on system
  • area_name_glacier_point_label: Referenced font Frutiger Neue Italic is not available on system
  • area_name_massif_label: Referenced font Frutiger Neue Regular is not available on system
  • boundary: Could not set opacity of layer, opacity already defined in stroke color
  • boundary_disputed: Could not set opacity of layer, opacity already defined in stroke color
  • bridge-l1_fill: Could not parse non-string color , skipping
  • bridge-l1_public_transport: Could not set opacity of layer, opacity already defined in stroke color
  • bridge-l1_road_casing: Could not parse non-string color , skipping
  • bridge-l1_road_track: Could not set opacity of layer, opacity already defined in stroke color
  • bridge-l2_fill: Could not parse non-string color , skipping
  • bridge-l2_public_transport: Could not set opacity of layer, opacity already defined in stroke color
  • bridge-l2_road_casing: Could not parse non-string color , skipping
  • bridge-l2_road_track: Could not set opacity of layer, opacity already defined in stroke color
  • building_ln: Could not set opacity of layer, opacity already defined in stroke color
  • construct: Could not parse non-string color , skipping
  • contour_line: Could not set opacity of layer, opacity already defined in stroke color
  • contour_line: Skipping unsupported expression
  • contour_line_water: Skipping unsupported expression

David...@swisstopo.ch

unread,
Jul 7, 2022, 3:03:21 AM7/7/22
to geoadm...@googlegroups.com

You need to use v2.0.0 to make it work

 

 

Daniel Ursprung

unread,
Jul 7, 2022, 3:55:13 AM7/7/22
to GeoAdminCh API
Thanks: now it works. The error message still appears, however, even though the map shows correctly.

The link you provided in your screenshot differs in two places from the link in the instructions here: https://github.com/cividi/geohackmin/discussions/48

On Github, it is
vectortiles10.geo.admin.ch... and v1.0.0/...

but you have
vectortiles.geo.admin.ch... (without 10) and and v2.0.0/...

So how do I know which URL to use when it will change again in the future? Is there a site to see which is the current version and what is the URL to use?

tiles.png

To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com

David...@swisstopo.ch

unread,
Jul 7, 2022, 4:47:54 AM7/7/22
to geoadm...@googlegroups.com, Sebastia...@swisstopo.ch

Official Product Docu http://vectortiles.geo.admin.ch/

Technical description http://api.geo.admin.ch/services/sdiservices.html#mapbox-vector-tiles

 

Always use vectortiles.geo.admin.ch

 

“So how do I know which URL to use when it will change again in the future?”

è Subscribe  to one of the channels mentioned in 2.2 of https://www.geo.admin.ch/terms-of-use

 

 

@Sebastian: can you have a look at this error in QGIS with the latest LBM style?

Sebastian Denier

unread,
Jul 7, 2022, 5:38:15 AM7/7/22
to GeoAdminCh API
I tried loading the light base map in QGIS. The maptiler plugin seems not able to load all style specifications correctly. Some opacities are wrong, various size specifications seem distorted, offsets of labels don't seem to work correctly, many map icons aren't displayed. I don't have a solution for this as this completely relies on the plugin provided by maptiler.

Daniel Ursprung

unread,
Jul 7, 2022, 5:38:43 PM7/7/22
to GeoAdminCh API
I do not use maptiler plugin, but the native Vector Tiles entry in layer panel:

vevtortiles.png

Julie Hofer

unread,
Oct 24, 2024, 12:06:33 PM10/24/24
to GeoAdminCh API
I was finally able to load the "Light Base Map" but it is very slow to use / has to reload every time when changing map view. Is there any better way to use this map as a base layer?

This is how I'm loading the vector tile:
qgis_vector tiles.png

I already removed some labels, but that doesn't seem to help.
(QGIS-Version 3.34.0-Prizren)
Reply all
Reply to author
Forward
0 new messages