外置路径¶
可以方便地计算您在外业某个要素的行程。 通过在QGIS中简单配置属性表单,可以在外业工作时通过超链接快速访问谷歌地图中的导航工具。
在QGIS中配置属性表单控件¶
桌面端筹备工作
此处是一个导航到点图层要素的示例。
在数据表创建一个新字段 (键入文本)。在属性表单设置中,选择 "附件" 作为控件类型。勾选 "文件路径使用超链接 (只读)"。 然后输入以下表达式作为默认值:
concat(
'https://www.google.com/maps/dir/?api=1&destination=',
y(transform($geometry, layer_property(@layer, 'crs'), 'EPSG:4326')),
'%2C',
x(transform($geometry, layer_property(@layer, 'crs'), 'EPSG:4326')),
'&travelmode=driving'
)
如果要对几何图形进行修改,请勾选 "更新时应用默认值"。
If you simply want to show your feature location in Google Maps, you can use the following expression:
concat( 'https://maps.google.com?q=',
y(transform($geometry, layer_property(@layer, 'crs'),'EPSG:4326')),
'%2C',
x(transform($geometry, layer_property(@layer, 'crs'),'EPSG:4326')),
'&zoom=19&t=h')
用法¶
QField界面
单击地图上想要导航到或在谷歌地图中打开的要素。在属性表单中,单击指向谷歌地图的链接。