アタッチメントを使う¶
QField では、Attachment ウィジェットを持つフィールドを使用できます:
- 写真の閲覧や撮影
- ビデオの表示と録画
- サウンドクリップを聴き、録音する
- PDFや書類のような外部ファイルのリンクを表示
ウィジェットを設定するには、属性フォームのドキュメントを参照してください。
地物に一連の写真を追加する¶
デスクトップの準備
地物には、1枚または複数の写真を追加することができます。以下にやり方の例を示します。
テーブル¶
2つのテーブルをセットアップする必要があります。1つは地物が保存されているテーブルで、もう1つは写真のリストです。
Apiary(養蜂場)¶
フィールド | データ型 |
---|---|
id |
テキスト (UUID) |
geometry |
ジオメトリ |
... |
Apiary_pictures(養蜂場の写真)¶
フィールド | データ型 |
---|---|
id |
テキスト (UUID) |
apiary_id |
Text (UUID) |
path |
テキスト |
... |
リレーション¶
リレーションを以下のように作成します:
apiary
参照レイヤid
参照フィールドapiary_picture
参照元レイヤapiary_id
参照元フィールドリレーションの強度
Composition
ウィジェット¶
Apiary(養蜂場)¶
フィールド ID のデフォルト値を uuid()
に設定するか、UUIDジェネレータ ウィジェットを使用してください。フォームに表示する必要はありません。
関係ウィジェットを 多対1リレーションに設定し、このリレーションをフォームに追加します。
養蜂場の写真¶
ウィジェットタイプを アタッチメント に設定し、フォームに追加します。
描画とスケッチ¶
QFieldにはアプリ内の描画・スケッチ機能があり、フィールドで撮影した画像の上に直接スケッチしたり注釈を付けたりできるほか、白紙のキャンバスの上やテンプレートの上に描画することもできます。
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