QGIS是否有这样的选项?
#1 楼
更新2019:不需要插件,请参见新答案:https://gis.stackexchange.com/a/217670/187更新2015:具有更多背景地图选项的新插件是QuickMapServices
:
原件:使用OpenLayers插件获取Google Maps,Bing,OSM或Yahoo背景图。
请注意,这些图层不适合打印! (请参阅https://gis.stackexchange.com/a/42141/187答案中的公开票证)
评论
建议进行编辑以将XYZ拼贴服务考虑在内。 tks :)
–tony gil
18年11月17日在9:53
在此页面上查看其他/较新的答案。在我撰写本文时,应获得最高投票。无需插件。
–mankoff
19年8月5日在16:29
#2 楼
不需要插件有一个核心功能XYZ Tile Server提供程序,该功能已通过其他一些针对切片服务的不错的UX增强实现(从QGIS 2.18开始可用)。这意味着不需要外部插件,尽管对于简单的设置,您仍然可以使用外部插件(请参阅本文的底部),并且它相对于基于纯插件的解决方案提供了各种改进。
在在浏览器面板上,找到Tile Server条目,然后右键单击它以添加新服务。
输入您要使用的服务的URL,替换
双击新创建的条目以将图层添加到地图。
图层添加方式如下:
加载速度更快
支持重投影
支持打印
以强大的方式缓存
与QField兼容
一些示例URL
OpenTopoMap
https://tile.opentopomap.org/{z}/{x}/{y}.png
(请参阅下面的评论以获取归因)
OpenStreetMap
http://tile.openstreetmap.org/{z}/{x}/{y}.png
Google Hybrid
https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}
/> Google Satellite
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
Google Road
https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}
(其他Google瓦片类型的代码可在此处找到)
Bing Aero
http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1
配置GUI
自版本0.18.7起并与QGIS结合使用> = 2.18.8可以将QuickMapServices用作配置图层的非常易于使用的工具。只需选中“使用本机渲染器”复选框(感谢@DmitryBaryshnikov)
评论
这些连接选项应默认添加到QGIS浏览器列表中。我认为任何GIS软件都只需单击一次或两次即可提供底图功能。
– Jwely
19年2月11日在21:37
默认情况下已添加OpenStreetMap。其他人则承担运输这些物品会引发法律问题的风险。如果有人知道默认情况下可以安全运输的其他服务(或可以提供法律建议),请联系QGIS邮件列表qgis.org/en/site/getinvolved/mailinglists.html。
– Matthias Kuhn
19年5月14日在7:02
刚刚被告知有关OpenTopoMap的信息-使用:tile.opentopomap.org {z} / {x} / {y} .png并将这样的引用添加到您的地图中”地图数据:©OpenStreetMap贡献者,SRTM |地图样式:©OpenTopoMap( CC-BY-SA)”(感谢@JakobMiksch)
– Juhele
19年8月18日在20:21
非常感谢。 OpenTopoMap的网址是tile.opentopomap.org {z} / {x} / {y} .png(“。org”之后缺少“ /”。)
–艾伦·哈珀(Alan Harper)
4月13日21:58
#3 楼
另一个在QGIS中添加底图的插件-QuickMapServices:QGIS Python插件存储库:https://plugins.qgis.org/plugins/quick_map_services/
有关插件的更多信息:
http://nextgis.ru/en/blog/quickmapservices/
http://nextgis.ru/en/blog / quickmapservices-with-contributed-services /
http://nextgis.ru/en/blog/quickmapservices-in-gray/
http://nextgis.ru/en/blog/qms-simple -basemaps-management /
评论
我有QGIS 2.18.3(Mac OS X),但是没有添加XYZ Tiles的选项。您确定所有2.18.x版本都具有XYZ磁贴吗?
–罗格(RutgerH)
19年1月14日在17:00
@RutgerH我正在使用QGIS 3(Mac OS X),它具有XYZ Tiles选项。
–盗版生态学家
19 Mar 5 '19 at 20:47
如何从openstreet底图中删除“ API密钥要求”水印?
–好奇的女孩
3月31日14:03
#4 楼
信用/作者:@Klas
Karlsson和@Matthias Kuhn答案的扩展。
Plugins > Python Console > Show Editor
将以下代码复制并粘贴到新的Python文件中并按
Run script
"""
This script should be run from the Python consol inside QGIS.
It adds online sources to the QGIS Browser.
Each source should contain a list with the folowing items (string type):
[sourcetype, title, authconfig, password, referer, url, username, zmax, zmin]
You can add or remove sources from the sources section of the code.
Script by Klas Karlsson
Sources from https://qms.nextgis.com/
Licence GPL-3
Regarding the terms of use for these background maps YOU will need to verify that you
follow the individual EULA that comes with the different services,
Most likely they will restrict how you can use the data.
"""
# Sources
sources = []
sources.append(["connections-xyz","Google Maps","","","","https://mt1.google.com/vt/lyrs=m&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D","","19","0"])
sources.append(["connections-xyz","Google Satellite", "", "", "", "https://mt1.google.com/vt/lyrs=s&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Google Terrain", "", "", "", "https://mt1.google.com/vt/lyrs=t&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Google Terrain Hybrid", "", "", "", "https://mt1.google.com/vt/lyrs=p&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Google Satellite Hybrid", "", "", "", "https://mt1.google.com/vt/lyrs=y&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Stamen Terrain", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/terrain/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Stamen Toner", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/toner/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Stamen Toner Light", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/toner-lite/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Stamen Watercolor", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/watercolor/%7Bz%7D/%7Bx%7D/%7By%7D.jpg", "", "18", "0"])
sources.append(["connections-xyz","Wikimedia Map", "", "", "OpenStreetMap contributors, under ODbL", "https://maps.wikimedia.org/osm-intl/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "1"])
sources.append(["connections-xyz","Wikimedia Hike Bike Map", "", "", "OpenStreetMap contributors, under ODbL", "http://tiles.wmflabs.org/hikebike/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "17", "1"])
sources.append(["connections-xyz","Esri Boundaries Places", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "20", "0"])
sources.append(["connections-xyz","Esri Gray (dark)", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "16", "0"])
sources.append(["connections-xyz","Esri Gray (light)", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "16", "0"])
sources.append(["connections-xyz","Esri National Geographic", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "12", "0"])
sources.append(["connections-xyz","Esri Ocean", "", "", "", "https://services.arcgisonline.com/ArcGIS/rest/services/Ocean/World_Ocean_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "10", "0"])
sources.append(["connections-xyz","Esri Satellite", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "17", "0"])
sources.append(["connections-xyz","Esri Standard", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "17", "0"])
sources.append(["connections-xyz","Esri Terrain", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "13", "0"])
sources.append(["connections-xyz","Esri Transportation", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "20", "0"])
sources.append(["connections-xyz","Esri Topo World", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "20", "0"])
sources.append(["connections-xyz","OpenStreetMap Standard", "", "", "OpenStreetMap contributors, CC-BY-SA", "http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "19", "0"])
sources.append(["connections-xyz","OpenStreetMap H.O.T.", "", "", "OpenStreetMap contributors, CC-BY-SA", "http://tile.openstreetmap.fr/hot/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "19", "0"])
sources.append(["connections-xyz","OpenStreetMap Monochrome", "", "", "OpenStreetMap contributors, CC-BY-SA", "http://tiles.wmflabs.org/bw-mapnik/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "19", "0"])
sources.append(["connections-xyz","OpenTopoMap", "", "", "Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)", "https://tile.opentopomap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "17", "1"])
sources.append(["connections-xyz","Strava All", "", "", "OpenStreetMap contributors, CC-BY-SA", "https://heatmap-external-b.strava.com/tiles/all/bluered/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "15", "0"])
sources.append(["connections-xyz","Strava Run", "", "", "OpenStreetMap contributors, CC-BY-SA", "https://heatmap-external-b.strava.com/tiles/run/bluered/%7Bz%7D/%7Bx%7D/%7By%7D.png?v=19", "", "15", "0"])
sources.append(["connections-xyz","Open Weather Map Temperature", "", "", "Map tiles by OpenWeatherMap, under CC BY-SA 4.0", "http://tile.openweathermap.org/map/temp_new/%7Bz%7D/%7Bx%7D/%7By%7D.png?APPID=1c3e4ef8e25596946ee1f3846b53218a", "", "19", "0"])
sources.append(["connections-xyz","Open Weather Map Clouds", "", "", "Map tiles by OpenWeatherMap, under CC BY-SA 4.0", "http://tile.openweathermap.org/map/clouds_new/%7Bz%7D/%7Bx%7D/%7By%7D.png?APPID=ef3c5137f6c31db50c4c6f1ce4e7e9dd", "", "19", "0"])
sources.append(["connections-xyz","Open Weather Map Wind Speed", "", "", "Map tiles by OpenWeatherMap, under CC BY-SA 4.0", "http://tile.openweathermap.org/map/wind_new/%7Bz%7D/%7Bx%7D/%7By%7D.png?APPID=f9d0069aa69438d52276ae25c1ee9893", "", "19", "0"])
sources.append(["connections-xyz","CartoDb Dark Matter", "", "", "Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.", "http://basemaps.cartocdn.com/dark_all/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","CartoDb Positron", "", "", "Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.", "http://basemaps.cartocdn.com/light_all/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Bing VirtualEarth", "", "", "", "http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1", "", "19", "1"])
# Add sources to browser
for source in sources:
connectionType = source[0]
connectionName = source[1]
QSettings().setValue("qgis/%s/%s/authcfg" % (connectionType, connectionName), source[2])
QSettings().setValue("qgis/%s/%s/password" % (connectionType, connectionName), source[3])
QSettings().setValue("qgis/%s/%s/referer" % (connectionType, connectionName), source[4])
QSettings().setValue("qgis/%s/%s/url" % (connectionType, connectionName), source[5])
QSettings().setValue("qgis/%s/%s/username" % (connectionType, connectionName), source[6])
QSettings().setValue("qgis/%s/%s/zmax" % (connectionType, connectionName), source[7])
QSettings().setValue("qgis/%s/%s/zmin" % (connectionType, connectionName), source[8])
# Update GUI
iface.reloadConnections()
执行代码后,底图列表将出现在“浏览器”面板中的
XYZ Tiles
下,请参见下图。参考文献:
OPEN.GIS.LAB |在QGIS 3.0中添加底图
qgis_basemaps.py
QGIS 3.6中的OpenLayers插件
#5 楼
如果您想将ESRI底图添加到QGIS,请使用QGIS Python控制台按照此博客文章中的步骤操作:将此代码复制并粘贴到QGIS Python控制台中:
添加ESRI_Imagery_World_2D服务:
qgis.utils.iface.addRasterLayer("http://server.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer?f=json&pretty=true","raster")
添加ESRI World_Street_Map服务:
qgis.utils.iface.addRasterLayer("https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer?f=json&pretty=true","raster")
那么您可以保存这些作为QGIS图层定义文件并将其稍后添加到任何项目中
这是可以使用上述代码添加的所有ArcGIS Online底图的REST端点:
https:/ /services.arcgisonline.com/arcgis/rest/services
评论
@spatialhast您知道如何查看从哪一年通过XYZ Tyles获取图层吗?谢谢