Anhänge verwenden¶
In QField kann ein Feld mit der Funktion Anhänge verwendet werden, um:
- Show and take photos
- Show and record videos
- Listen and record sound clips
- Show links to external files like PDFs or documents
To configure the Widget, please refer to the Attributes Form Documentation
Eine Reihe von Bildern zu einem Objekt hinzufügen¶
Vorbereitung am Schreibtisch
It is also possible to add more pictures to the feature either by having several attachment field attributes or by creating a relation to a separate table where the image paths are shown. In this section we will show you an example how this is done. A relation to a second layer needs to be set in the QGIS properties so that when adding images or other formats, these are stored in the related table.
Workflow
-
Create two two tables following the style as shown below. One table where the features are stored and one with a list of pictures.
Apiary:
Field Type id
Text (UUID) geometry
Geometry ...
Apiary_pictures:
Field Type id
Text (UUID) apiary_id
Text (UUID) path
Text ...
Beziehungen¶
Erstelle eine Beziehung mit:
apiary
Referenzierter Layerid
Referenziertes Feldapiary_picture
zu refernzierender Layerapiary_id
zu referenzierendes Feldstrength
Zusammenstellung
Attribute Form configuration¶
Once you have created the relation the relation can be properly configured in the feature layer's attribute forms. In the apiary layer we have to specify a default value to create a unique id. For the apiary_picture layer, you will have to change the widget type to Attachment
Workflow
Apiary
- Direct to Properties > Attribute Form
- For the uuid field choose between the Text Edit or UUID Generator widget.
- Set the default value to
uuid('WithoutBraces')
. - Hide it from the view as it should not be edited by the user.
Legen Sie das Beziehungs-Widget auf Viele-zu-Eins-Beziehung fest und fügen Sie die Beziehung zum Formular hinzu.
**Apiary_picture**
1. Direct to *Properties* > *Attribute Form*
2. Set the widget type of the field `path` to *Attachment*
3. Add it to the form layout.
Zeichnen und Skizzieren¶
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" by pressing the (⋮) menu icon of the attachment widget.
Geotagging¶
Feldarbeit
QField's internal; camera will automatically geotag your pictures.
Informationen über den Standort und die Richtung der Bilder werden daher in die Bilddatei eingebettet.
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.
Image Stamping¶
QField allows you to add image stamping. This is configured directly from the QFieldSync plugin in QGIS. With this functionality you can add detailed and formatted information when taking photos in the field.
Styling Settings¶
Vorbereitung am Schreibtisch
Navigate to the Project > Properties > QField > Attachments and Directories sub-panel and click on "Settings" for "Customize image stamping details".
You can add the following settings:
-
Font and Alignment: You have full control over the appearance of the stamped text, including the font style (color, size, drop shadow) and horizontal alignment (left, center, or right).
-
Image Decoration: Add a custom image overlay, such as a logo or a watermark, on top of the captured image.
-
Force Stamping: This option enforces image stamping, ensuring that all images collected for the project have the required information overlaid, regardless of the individual QField app settings.
-
Stamp Details: Craft a multiline string using QGIS expressions to define the information stamped on the image. A default template is provided to get you started, which includes common variables like date, time, and GNSS information.
Default Template:
[% format_date(now(), 'yyyy-MM-dd @ HH:mm') %]
Latitude [% coalesce(format_number(y(@gnss_coordinate), 7), 'N/A') %] | Longitude [% coalesce(format_number(x(@gnss_coordinate), 7), 'N/A') %] | Altitude [% coalesce(format_number(z(@gnss_coordinate), 3) || ' m', 'N/A') %]
Speed [% if(@gnss_ground_speed != 'nan', format_number(@gnss_ground_speed, 3) || ' m/s', 'N/A') %] | Orientation [% if(@gnss_orientation != 'nan', format_number(@gnss_orientation, 1) || ' °', 'N/A') %]
Example
Einbetten von Geotags (EXIF) aus der Bilddatei in die Attributtabelle¶
Vorbereitung am Schreibtisch
Sometimes you might be interested in automatically storing Geotags such as the latitude, longitude, orientation, etc. This information is also known as EXIF tags.
Um die EXIF-Informationen zu speichern, gehen Sie folgendermaßen vor:
- Fügen Sie ein Attribut pro EXIF-Tag in der Tabelle hinzu, die die Bilder enthält.
- Konfigurieren Sie im Bild-Formular den Standardwert jedes Attributs für den entsprechenden EXIF expression See QGIS EXIF function, und stellen Sie sicher, dass Bei Update anwenden aktiviert ist.
- Die EXIF-Tags, die QField erfassen kann, sind in der QGIS-Dokumentation aufgelistet (Link oben). 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.
Maximale Bildgröße¶
Vorbereitung am Schreibtisch
The advanced settings allow rescaling the photos to a maximum width/height in Project > Properties > Attachments and Directories
Konfigurierbarer Anhang-Pfad¶
Vorbereitung am Schreibtisch
QFieldSync provides the possibility to configure the path and the file names of picture attachments.
- Go to Vector Layer Properties > QField
- Wählen Sie die Ebene, das Feld und konfigurieren Sie den Ausdruck.
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 and Directories tab in the QFieldSync settings under Project > Properties > QField. All paths are relative to the project directory.