Usa allegato¶
In QField, un campo con il widget Allegato può essere usato per:
- mostrare e scattare foto
- mostrare e registrare video
- ascoltare e registrare clip audio
- mostrare link a file esterni come PDF o documenti
Per configurare il Widget, fai riferimento al Documentazione Modulo Attributi
Aggiungi una serie di immagini a un elemento¶
Preparazione da Desktop
Una o più immagini possono essere aggiunte all'elemento. Ecco un esempio di come procedere.
Tabelle¶
È necessario impostare due tabelle. Una tabella in cui sono memorizzati gli elementi e una con un elenco di immagini.
Apiary¶
Campo | Tipo |
---|---|
id |
Text (UUID) |
geometry |
Geometria |
... |
Apiary_pictures¶
Campo | Tipo |
---|---|
id |
Text (UUID) |
apiary_id |
Text (UUID) |
path |
Text |
... |
Relazioni¶
Crea una relazione con:
apiary
Layer di riferimentoid
Campo di riferimentoapiary_picture
Layer che fa riferimentoapiary_id
Campo che fa riferimentostrength
Composizione
Widget¶
Apiary¶
Imposta il valore predefinito dell'id del campo a uuid()
o utilizza il widget UUID Generator. Non è necessario mostrarlo nel modulo.
Imposta il widget della relazione su relazione uno a molti e aggiungi la relazione al modulo
Immagine dell'apiario¶
Imposta il tipo di widget del percorso del campo a Attachment e aggiungilo al modulo
Drawing and sketching¶
QField have 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.
Geotagging¶
Fieldwork
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. If you enable Use native Camera in the settings you will not be able to preserve EXIF information.
Fetching Geotags (EXIF) from the image file into the attribute table¶
Desktop preparation
Sometimes you might be interested in automatically storing Geotags such as the latitude, longitude, orientation, etc. This information is also known as EXIF tags.
To store the EXIF information, follow these steps:
- Add an attribute per EXIF tag in the table that contains the pictures.
- In the pictures form, configure the default value of each attribute to the corresponding EXIF expression See QGIS EXIF function, and make sure Apply on update is activated.
- The EXIF tags that QField can capture are listed in the QGIS documentation (link above). However, this list might slightly varies 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's now capture and store the EXIF tags in the pictures table while taking pictures.
Maximum picture size¶
Desktop preparation
The advanced settings allow rescaling the photos to a maximum width/height in QFieldSync plugin > Project configuration
Configurable attachment path¶
Desktop preparation
QFieldSync provides the possibility to configure the path of picture attachments.
- Go to QFieldSync plugin > Layers Properties
- Choose the layer, the field and configure the expression
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. All paths are relative to the project directory.
Note
QGIS 3.14 or newer is required for this functionality