使用附件¶
在QField中,带有 附件 控件的字段可用于:
- 显示和拍照
- 显示和录制视频
- 收听并录制声音片段
- 显示指向外部文件 (如PDF或文档) 的链接
要配置控件,请参阅 属性表单文档
为要素添加多张图片¶
桌面端筹备工作
One or more pictures can be added to the feature. Here is an example of how to proceed.
表¶
It is necessary to set up two tables. One table where the features are stored and one with a list of pictures.
Apiary¶
字段 | 类型 |
---|---|
id |
文本 (UUID) |
geometry |
几何图形 |
... |
Apiary_pictures¶
字段 | 类型 |
---|---|
id |
文本 (UUID) |
apiary_id |
文本 (UUID) |
path |
文本 |
... |
关系¶
创建关系如下:
apiary
被引用图层id
被引用字段apiary_picture
引用图层apiary_id
引用字段strength
组合
控件¶
Apiary¶
Set the default value of the field id to uuid()
or use the UUID Generator widget.
There is no need to show it in the form.
将关系控件设置为 多对一关系 并将关系添加到表单
Apiary picture¶
将字段路径的控件类型设置为 附件 并将其添加到表单
Drawing and sketching¶
QField has an in-app drawing and sketching functionality enabling you to directly sketch over and annotate images captured while in the field as well as drawing on top of a blank canvas or over a template.
Drawing templates¶
On top of annotating captured images, QField supports drawing from image templates. The following two methods are available to add templates:
- The first method is to create a
drawing_templates
folder located alongside a project file and populate it with images. Whenever that project is loaded, QField will register all images within that folder as drawing templates. - Alternatively, you can add images into the
drawing_templates
folder found inside your QField app folder. If you are not familiar with that app folder, its location is shown at the bottom of the About QField overlay.
Templates shipped alongside projects as well as the QField app folder will be shown when users choose 'Draw a sketch' within attachments widget's 3-dot menu.
地理标记¶
QField界面
QField's internal camera will automatically geotag your pictures.
Information about location and direction of the pictures will therefore be baked into the image file.
Note
While with older Android versions it was possible to use other apps like the amazing OpenCamera app for taking pictures and preserving EXIF information from there, this is no longer with recent Android versions. Is recommended to disable Use native Camera in the settings to preserve EXIF information.
将图像文件中的地理标签 (EXIF) 提取到属性表¶
桌面端筹备工作
Sometimes you might be interested in automatically storing Geotags such as the latitude, longitude, orientation, etc. This information is also known as EXIF tags.
要存储EXIF信息,请执行以下步骤:
- 在包含图片的表中为每个EXIF标签添加属性。
- 在图片表单中,将每个属性的默认值配置为相应的 EXIF表达式 参见 QGIS EXIF 函数, 并确保 更新时应用 已激活。
- QGIS文档列出了QField可以捕获的EXIF标签 (上面的链接)。 However, this list might slightly vary depending on the mobile characteristics.
- Capturing EXIF tags requires accessing the full physical path of the picture.
Be sure to reflect this in the QGIS expression.
For example, the expression
exif(@project_folder + '/' + "path", 'Exif.Image.Orientation')
retrieves the orientation of the picture stored in path. For more tags visit the QField EXIF reference documentation and the exiv library documentation. - Completed! QField now captures and stores the EXIF tags in the pictures table while taking pictures.
最大图片尺寸¶
桌面端筹备工作
高级设置允许在 QField同步插件 > 工程配置 中将照片重新缩放到最大宽度或高度
配置附件路径¶
桌面端筹备工作
QFieldSync provides the possibility to configure the path and the file names of picture attachments.
- Go to *Layer Properties > QFieldSync plugin *
- 选择图层、字段并配置表达式
Use expressions to specify the path of the attachments. By default, pictures are saved into the "DCIM" folder, audio are saved into the "audio" folder and videos are saved into "video" with a timestamp as name.
Additional directories can be synchronized with pictures or other attachments. Extra paths can be configured in Attachment directories in the QFieldSync settings under project properties. All paths are relative to the project directory.