-
Notifications
You must be signed in to change notification settings - Fork 16
/
qgis_basemaps.py
182 lines (173 loc) · 30.2 KB
/
qgis_basemaps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# This script is inspired by Klas Karlsson at https://bit.ly/4eDbx1O. Credit to Klas Karlsson.
# I expaned the script to include more XYZ basemaps from xyzservices and a lot of WMS basemaps.
from qgis.PyQt.QtCore import QSettings
from qgis.utils import iface
print('Adding basemaps to QGIS now. Please wait ...')
sources = []
sources.append(['connections-xyz', 'Bing VirtualEarth', '', '', 'Microsoft', 'http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1', '', '30', '1'])
sources.append(['connections-xyz', 'OpenStreetMap', '', '', 'OpenStreetMap', 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Google Maps', '', '', 'Google', 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', '', '30', '0'])
sources.append(['connections-xyz', 'Google Satellite', '', '', 'Google', 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', '', '30', '0'])
sources.append(['connections-xyz', 'Google Terrain', '', '', 'Google', 'https://mt1.google.com/vt/lyrs=p&x={x}&y={y}&z={z}', '', '30', '0'])
sources.append(['connections-xyz', 'Google Hybrid', '', '', 'Google', 'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', '', '30', '0'])
sources.append(['connections-xyz', 'BaseMapDE.Color', '', '', 'Map data: (C) dl-de/by-2-0', 'https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_farbe/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'BaseMapDE.Grey', '', '', 'Map data: (C) dl-de/by-2-0', 'https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_grau/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.DarkMatter', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.DarkMatterNoLabels', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.DarkMatterOnlyLabels', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.Positron', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.PositronNoLabels', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.PositronOnlyLabels', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.Voyager', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.VoyagerLabelsUnder', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.VoyagerNoLabels', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CartoDB.VoyagerOnlyLabels', '', '', '(C) OpenStreetMap contributors (C) CARTO', 'https://a.basemaps.cartocdn.com/rastertiles/voyager_only_labels/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'CyclOSM', '', '', 'CyclOSM | Map data: (C) OpenStreetMap contributors', 'https://a.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.AntarcticBasemap', '', '', 'Imagery provided by NOAA National Centers for Envi', 'https://tiles.arcgis.com/tiles/C8EMgrsFcRFL6LrL/arcgis/rest/services/Antarctic_Basemap/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.AntarcticImagery', '', '', 'Earthstar Geographics', 'http://server.arcgisonline.com/ArcGIS/rest/services/Polar/Antarctic_Imagery/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.ArcticImagery', '', '', 'Earthstar Geographics', 'http://server.arcgisonline.com/ArcGIS/rest/services/Polar/Arctic_Imagery/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.ArcticOceanBase', '', '', 'Tiles © Esri — Esri, DeLorme, NAVTEQ, T', 'http://server.arcgisonline.com/ArcGIS/rest/services/Polar/Arctic_Ocean_Base/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.ArcticOceanReference', '', '', 'Tiles © Esri — Esri, DeLorme, NAVTEQ, T', 'http://server.arcgisonline.com/ArcGIS/rest/services/Polar/Arctic_Ocean_Reference/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.NatGeoWorldMap', '', '', 'Tiles (C) Esri -- National Geographic, Esri, DeLor', 'https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.OceanBasemap', '', '', 'Tiles (C) Esri -- Sources: GEBCO, NOAA, CHS, OSU, ', 'https://server.arcgisonline.com/ArcGIS/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldGrayCanvas', '', '', 'Tiles (C) Esri -- Esri, DeLorme, NAVTEQ', 'https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldImagery', '', '', 'Tiles (C) Esri -- Source: Esri, i-cubed, USDA, USG', 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldPhysical', '', '', 'Tiles (C) Esri -- Source: US National Park Service', 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldShadedRelief', '', '', 'Tiles (C) Esri -- Source: Esri', 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldStreetMap', '', '', 'Tiles (C) Esri -- Source: Esri, DeLorme, NAVTEQ, U', 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldTerrain', '', '', 'Tiles (C) Esri -- Source: USGS, Esri, TANA, DeLorm', 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'Esri.WorldTopoMap', '', '', 'Tiles (C) Esri -- Esri, DeLorme, NAVTEQ, TomTom, I', 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'FreeMapSK', '', '', '(C) OpenStreetMap contributors, visualization CC-B', 'https://a.freemap.sk/T/{z}/{x}/{y}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'Gaode.Normal', '', '', '© <a href="http://www.gaode.com/">Gaode.com</', 'http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}', '', '30', '0'])
sources.append(['connections-xyz', 'Gaode.Satellite', '', '', '© <a href="http://www.gaode.com/">Gaode.com</', 'http://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', '', '30', '0'])
sources.append(['connections-xyz', 'HikeBike.HikeBike', '', '', '(C) OpenStreetMap contributors', 'https://tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'HikeBike.HillShading', '', '', '(C) OpenStreetMap contributors', 'https://tiles.wmflabs.org/hillshading/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.americanIndian', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/indian/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.asian', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/asian/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.black', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/black/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.hispanic', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/hispanic/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.income', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/income/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.multi', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/multi/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.nonWhite', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/nonwhite/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.plurality', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/plural/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'JusticeMap.white', '', '', 'Justice Map', 'https://www.justicemap.org/tile/county/white/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'MtbMap', '', '', '(C) OpenStreetMap contributors & USGS', 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ASTER_GDEM_Greyscale_Shaded_Relief', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/ASTER_GDEM_Greyscale_Shaded_Relief/default/GoogleMapsCompatible_Level12/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.BlueMarble', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/BlueMarble_NextGeneration/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.BlueMarble3031', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/BlueMarble_NextGeneration/default/500m/{z}/{y}/{x}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.BlueMarble3413', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3413/best/BlueMarble_NextGeneration/default/500m/{z}/{y}/{x}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.BlueMarbleBathymetry3031', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/BlueMarble_ShadedRelief_Bathymetry/default/500m/{z}/{y}/{x}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.BlueMarbleBathymetry3413', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3413/best/BlueMarble_ShadedRelief_Bathymetry/default/500m/{z}/{y}/{x}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.MEaSUREsIceVelocity3031', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/MEaSUREs_Ice_Velocity_Antarctica/default/500m/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.MEaSUREsIceVelocity3413', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3413/best/MEaSUREs_Ice_Velocity_Greenland/default/500m/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisAquaBands721CR', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Aqua_CorrectedReflectance_Bands721/default//GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisAquaTrueColorCR', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Aqua_CorrectedReflectance_TrueColor/default//GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraAOD', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_Aerosol/default//GoogleMapsCompatible_Level6/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraBands367CR', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_CorrectedReflectance_Bands367/default//GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraBands721CR', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Terra_CorrectedReflectance_Bands721/default//GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraChlorophyll', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_L2_Chlorophyll_A/default//GoogleMapsCompatible_Level7/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraLSTDay', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_Land_Surface_Temp_Day/default//GoogleMapsCompatible_Level7/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraSnowCover', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_NDSI_Snow_Cover/default//GoogleMapsCompatible_Level8/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ModisTerraTrueColorCR', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_CorrectedReflectance_TrueColor/default//GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ViirsEarthAtNight2012', '', '', 'Imagery provided by services from the Global Image', 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/VIIRS_CityLights_2012/default//GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'NASAGIBS.ViirsTrueColorCR', '', '', 'Imagery provided by services from the Global Image', 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_SNPP_CorrectedReflectance_TrueColor/default//GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg', '', '30', '0'])
sources.append(['connections-xyz', 'OPNVKarte', '', '', 'Map memomaps.de CC-BY-SA, map data (C) OpenStreetM', 'https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OneMapSG.Default', '', '', '![](https://docs.onemap.sg/maps/images/oneMap64-01', 'https://maps-a.onemap.sg/v3/Default/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OneMapSG.Grey', '', '', '![](https://docs.onemap.sg/maps/images/oneMap64-01', 'https://maps-a.onemap.sg/v3/Grey/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OneMapSG.LandLot', '', '', '![](https://docs.onemap.sg/maps/images/oneMap64-01', 'https://maps-a.onemap.sg/v3/LandLot/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OneMapSG.Night', '', '', '![](https://docs.onemap.sg/maps/images/oneMap64-01', 'https://maps-a.onemap.sg/v3/Night/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OneMapSG.Original', '', '', '![](https://docs.onemap.sg/maps/images/oneMap64-01', 'https://maps-a.onemap.sg/v3/Original/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenAIP', '', '', 'openAIP Data (CC-BY-NC-SA)', 'https://1.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenFireMap', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenRailwayMap', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://a.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenSeaMap', '', '', 'Map data: (C) OpenSeaMap contributors', 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenSnowMap.pistes', '', '', 'Map data: (C) OpenStreetMap contributors & ODbL, (', 'https://tiles.opensnowmap.org/pistes/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenStreetMap.BZH', '', '', '(C) OpenStreetMap contributors, Tiles courtesy of ', 'https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenStreetMap.BlackAndWhite', '', '', '(C) OpenStreetMap contributors', 'http://a.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenStreetMap.CH', '', '', '(C) OpenStreetMap contributors', 'https://tile.osm.ch/switzerland/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenStreetMap.DE', '', '', '(C) OpenStreetMap contributors', 'https://tile.openstreetmap.de/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenStreetMap.HOT', '', '', '(C) OpenStreetMap contributors, Tiles style by Hum', 'https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenStreetMap.Mapnik', '', '', '(C) OpenStreetMap contributors', 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'OpenTopoMap', '', '', 'Map data: (C) OpenStreetMap contributors, SRTM | M', 'https://a.tile.opentopomap.org/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'SafeCast', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://s3.amazonaws.com/te512.safecast.org/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Strava.All', '', '', 'Map tiles by <a href="https://labs.strava.com/heat', 'https://heatmap-external-a.strava.com/tiles/all/hot/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Strava.Ride', '', '', 'Map tiles by <a href="https://labs.strava.com/heat', 'https://heatmap-external-a.strava.com/tiles/ride/hot/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Strava.Run', '', '', 'Map tiles by <a href="https://labs.strava.com/heat', 'https://heatmap-external-a.strava.com/tiles/run/bluered/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Strava.Water', '', '', 'Map tiles by <a href="https://labs.strava.com/heat', 'https://heatmap-external-a.strava.com/tiles/water/blue/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'Strava.Winter', '', '', 'Map tiles by <a href="https://labs.strava.com/heat', 'https://heatmap-external-a.strava.com/tiles/winter/hot/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'SwissFederalGeoportal.JourneyThroughTime', '', '', '© swisstopo', 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.zeitreihen/default/18641231/3857/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'SwissFederalGeoportal.NationalMapColor', '', '', '© swisstopo', 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/{z}/{x}/{y}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'SwissFederalGeoportal.NationalMapGrey', '', '', '© swisstopo', 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-grau/default/current/3857/{z}/{x}/{y}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'SwissFederalGeoportal.SWISSIMAGE', '', '', '© swisstopo', 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/{z}/{x}/{y}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'TopPlusOpen.Color', '', '', 'Map data: (C) dl-de/by-2-0', 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'TopPlusOpen.Grey', '', '', 'Map data: (C) dl-de/by-2-0', 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web_grau/default/WEBMERCATOR/{z}/{y}/{x}.png', '', '30', '0'])
sources.append(['connections-xyz', 'USGS.USImagery', '', '', 'Tiles courtesy of the U.S. Geological Survey', 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'USGS.USImageryTopo', '', '', 'Tiles courtesy of the U.S. Geological Survey', 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'USGS.USTopo', '', '', 'Tiles courtesy of the U.S. Geological Survey', 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}', '', '30', '0'])
sources.append(['connections-xyz', 'WaymarkedTrails.cycling', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'WaymarkedTrails.hiking', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'WaymarkedTrails.mtb', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://tile.waymarkedtrails.org/mtb/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'WaymarkedTrails.riding', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://tile.waymarkedtrails.org/riding/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'WaymarkedTrails.skating', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://tile.waymarkedtrails.org/skating/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'WaymarkedTrails.slopes', '', '', 'Map data: (C) OpenStreetMap contributors | Map sty', 'https://tile.waymarkedtrails.org/slopes/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'nlmaps.grijs', '', '', 'Kaartgegevens (C) Kadaster', 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/grijs/EPSG:3857/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'nlmaps.luchtfoto', '', '', 'Kaartgegevens (C) Kadaster', 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg', '', '30', '0'])
sources.append(['connections-xyz', 'nlmaps.pastel', '', '', 'Kaartgegevens (C) Kadaster', 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/pastel/EPSG:3857/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'nlmaps.standaard', '', '', 'Kaartgegevens (C) Kadaster', 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:3857/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-xyz', 'nlmaps.water', '', '', 'Kaartgegevens (C) Kadaster', 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/water/EPSG:3857/{z}/{x}/{y}.png', '', '30', '0'])
sources.append(['connections-wms', 'USGS 3DEP Elevation', 'https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS 3DEP Elevation Index', 'https://index.nationalmap.gov/arcgis/services/3DEPElevationIndex/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Base Map', 'https://basemap.nationalmap.gov/arcgis/services/USGSTNMBlank/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Hydrography', 'https://basemap.nationalmap.gov/arcgis/services/USGSHydroCached/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Imagery Topo Base Map', 'https://basemap.nationalmap.gov/arcgis/services/USGSImageryTopo/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS ImageryOnly Base Map', 'https://basemap.nationalmap.gov/arcgis/services/USGSImageryOnly/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Shaded Relief', 'https://basemap.nationalmap.gov/arcgis/services/USGSShadedReliefOnly/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS NAIP Imagery', 'https://imagery.nationalmap.gov/arcgis/services/USGSNAIPImagery/ImageServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Topo Base Map', 'https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Topo Availability', 'https://index.nationalmap.gov/arcgis/services/USTopoAvailability/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Contours', 'https://carto.nationalmap.gov/arcgis/services/contours/MapServer/WMSServer?', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Geographic Names (GNIS)', 'https://carto.nationalmap.gov/arcgis/services/geonames/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Governmental Unit Boundaries', 'https://carto.nationalmap.gov/arcgis/services/govunits/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Imagery (NAIP Plus)', 'https://imagery.nationalmap.gov/arcgis/services/USGSNAIPPlus/ImageServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Imagery - NAIP 4 Band', 'https://imagery.nationalmap.gov/arcgis/services/USGSNAIPImagery/ImageServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Map Indices', 'https://carto.nationalmap.gov/arcgis/services/map_indices/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS NHDPlus High Resolution', 'https://hydro.nationalmap.gov/arcgis/services/NHDPlus_HR/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS National Hydrography Dataset', 'https://hydro.nationalmap.gov/arcgis/services/nhd/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Reference Polygons', 'https://carto.nationalmap.gov/arcgis/services/selectable_polygons/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Special Edition 250k Maps', 'https://index.nationalmap.gov/arcgis/services/USGS_250K_Special_Edition_Maps/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Structures', 'https://carto.nationalmap.gov/arcgis/services/structures/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Transportation', 'https://carto.nationalmap.gov/arcgis/services/transportation/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS 3D Hydrography Program (3DHP)', 'https://hydro.nationalmap.gov/arcgis/services/3DHP_all/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Watershed Boundary Dataset', 'https://hydro.nationalmap.gov/arcgis/services/wbd/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'BLM Public Land Survey System (PLSS)', 'https://gis.blm.gov/arcgis/services/Cadastral/BLM_Natl_PLSS_CadNSDI/MapServer/WMSServer', 'BLM', '30', '0'])
sources.append(['connections-wms', 'FWS Wetlands', 'https://www.fws.gov/wetlandsmapservice/services/Wetlands/MapServer/WMSServer', 'FWS', '30', '0'])
sources.append(['connections-wms', 'USGS Protected Area Fee Manager (PADUS)', 'https://gis1.usgs.gov/arcgis/services/padus3/Fee_Managers/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Protected Area GAP Status (PADUS)', 'https://gis1.usgs.gov/arcgis/services/padus3/Protection_Status_by_GAP_Status_Code/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Protected Area Manager Type (PADUS)', 'https://gis1.usgs.gov/arcgis/services/padus3/Manager_Type/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'USGS Trails', 'https://partnerships.nationalmap.gov/arcgis/services/USGSTrails/MapServer/WMSServer', 'USGS', '30', '0'])
sources.append(['connections-wms', 'NLCD Canopy Cover', 'https://www.mrlc.gov/geoserver/NLCD_Canopy/wms', 'USGS', '30', '0'])
sources.append(['connections-wms', 'NLCD Impervious Descriptor', 'https://www.mrlc.gov/geoserver/NLCD_Impervious_Descriptor/wms', 'USGS', '30', '0'])
sources.append(['connections-wms', 'NLCD Imperviousness', 'https://www.mrlc.gov/geoserver/NLCD_Impervious/wms', 'USGS', '30', '0'])
sources.append(['connections-wms', 'NLCD Land Cover', 'https://www.mrlc.gov/geoserver/NLCD_Land_Cover/wms', 'USGS', '30', '0'])
sources.append(['connections-wms', 'NLCD Shrublands', 'https://www.mrlc.gov/geoserver/NLCD_Shrubland/wms', 'USGS', '30', '0'])
sources.append(['connections-wms', 'EOX Maps', 'https://tiles.maps.eox.at/wms', 'EOX', '30', '0'])
sources.append(['connections-wms', 'Terrascope', 'https://services.terrascope.be/wms/v2', 'Terrascope', '30', '0'])
sources.append(['connections-wms', 'NASA GIBS WMS', 'https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi', 'NASA', '30', '0'])
for source in sources:
connectionType = source[0]
connectionName = source[1]
if connectionType == "connections-xyz":
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/authcfg", source[2])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/password", source[3])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/referer", source[4])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/url", source[5])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/username", source[6])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/zmax", source[7])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/zmin", source[8])
elif connectionType == "connections-wms":
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/url", source[2])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/referer", source[3])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/zmax", source[4])
QSettings().setValue(f"qgis/{connectionType}/{connectionName}/zmin", source[5])
iface.reloadConnections()
print("All basemaps have been added. Please restart QGIS.")