コンテンツにスキップ

QFieldSync

The QFieldSync plugin for QGIS helps preparing and packaging QGIS projects for QField.

QFieldSyncは、次の自動化によりプロジェクトを準備するのをサポートします。

  • Required steps for project setup (e.g. portable_project)
  • 一枚のラスタレイヤー定義されたスタイルからのベースマップの生成または、 マップテーマによってできます。
  • オフライン編集機能の構成と 変更内容の同期

ワークフロー

プロセスの概要を簡単に説明するために、一般的な手順のリストを以下に示します。

  1. QFieldパッケージを生成します。 folder.
  2. QFieldパッケージを対象のデバイスにコピーします。
  3. フィールドにデータ収集に行きましょう。
  4. 更新したデータをデスクトップマシンにコピーして戻します。
  5. 更新したデータをデータベースもしくはファイルと同期します。

インストール

QGISでプラグインライブラリを開いて、 qfield sync と検索します。リストの中のプラグインを選択し、 インストール をクリックします。

QGISプラグインリポジトリのQField Syncプラグイン
QGISプラグインリポジトリのQField Syncプラグイン

構成

The project configuration is saved in the master .qgs project file. This way it is possible to pre-configure a project once and use it repeatedly.

プロジェクトの設定
プロジェクトの設定

レイヤーの構成

プロジェクトレイヤの設定
プロジェクトレイヤの設定

In the project configuration dialog, an action can be defined for each layer individually. Depending on the layer type, different types of actions are available.

Copy

The layer will be copied to the package folder. This is only available for file-based layers.

No action

:そのレイヤーのデータソースに対しては何も変更しません。これはWMS、WFSやPostGISなどの非ファイルベースのレイヤーに対してのみ使用できます。

Offline editing

A working copy of the layer is copied into the package folder. Every change which is done in the packaged project during work is recorded in a changelog. When synchronizing the changes back later on, this log will be replaced and all changes also be applied to the main data base. There is no conflict handling in place.

Remove

The layer will be removed from the working copy. This is useful if a layer is used in the basemap and will not be available in the packaged project.

Properties

There are some additional options to fine tune your QField project in the properties:

  1. Permissions: Disable options for feature addition, feature deletion, attribute editing, or geometry editing.

  2. 添付ファイルのデフォルトの名前の設定は Configurable picture pathを参照ください。

  3. Set up the maximum number of items shown in the relation editor widget.

QFieldSyncのレイヤプロパティ
QFieldSyncのレイヤプロパティ

QFieldの表示される項目の最大数の設定

QField 内のリレーションシップで表示されている項目の最大数を調整するには、以下の手順に従います:

  1. レイヤープロパティダイアログへのアクセス:
  2. QGISのレイヤープロパティダイアログを開き、リレーションエディタを表示します。

  3. QFieldタブへ移動:

  4. レイヤープロパティダイアログの一番下にある QField タブを探します。

  5. リレーションシップ設定の変更:

  6. 「リレーションシップ設定」セクションで、修正したいリレーションシップに対応するセクションを探します。

  7. 表示可否制限の調整:

  8. 目的のリレーションシップの行で、「表示されている項目の最大数」という列を見つけます。
  9. 既存の数値を削除して可視性を「無制限」に設定すると、フィールドは数値(デフォルト4)から「無制限」に変換されます。
  10. 「適用」をクリックして、レイヤープロパティの変更を保存します。

リレーションシップの最大表示項目数
リレーションシップの最大表示項目数

QFieldで表示される項目
QFieldで表示される項目

ベースマップの構成

ベースマップは、パッケージ化されたプロジェクトファイルの一番下のレイヤーとして追加されるラスターレイヤーです。

ベースマップオプションが有効になっている場合、プロジェクトがパッケージ化されるたびにベースマップがレンダリングされます。 関心のあるエリアーレンダリングされる範囲ーは、パッケージング時に選択されます。

ベースマップには2つのソースがあります。

レイヤー

A raster layer is useful for taking an offline copy of an online layer like a WMS or to take a working copy of an unsupported format like an ECW or MrSID layer.

マップテーマ

A map theme is useful for creating a base map based on a combination of several layers with styling. These layers can then be removed from the working package and do not need to be rendered on the device. This can save some disk space and battery on the device.

The tile size defines the spatial resolution. It determines the number of map units per pixel. If the map canvas CRS has meters as units and tile size is set to 1, each raster pixel will have a spatial extent of 1x1 m, if it is set to 1000, each raster pixel will have a spatial extent of 1 square kilometer.

You can package a raster layer into an MBTiles file with multiple zoom levels for offline use.

  • Tiles min zoom level: Defines the minimum zoom level for the raster tiles. A lower value increases the spatial coverage but the spatial resolution is limited. (Default: 14)
  • Tiles max zoom level: Defines the maximum zoom level for the raster tiles. A higher value increases detail but may require more storage space, as well as increase the duration of the offline export. (Default: 14)

Base Map Configuration QFieldSync
Base Map Configuration QFieldSync

Note

Base map generation is disabled on QFieldCloud. You can still manually add your basemaps by running "Generate XYZ tiles (MBTiles)" or "Convert map to raster" algorithms in the processing framework.

オフライン編集の構成

If "Only synchronize features in area of interest" is selected, only features that are within the established extent area or the current map canvas (if not set) at packaging time will be copied to the offline editing working copy.

Note

This is available only for the "Cable Export" option.

QField用にパッケージする

To package your project, click on Plugins > QFieldSync > Package for QField. Once the project is configured, proceed to package it into a folder. This folder will contain both the QGIS project file (.qgs) and the associated data.

QField用にプロジェクトをパッケージする
QField用にプロジェクトをパッケージする

QFieldSyncはデフォルトでパッケージングオプションをツールバーパネルに表示しませんが、Plugins > QFieldSync > Preferencesからアクセスできます。

QFieldSync Preferences button
QFieldSync Preferences button

"パッケージングオプションをツールバーに表示"のチェックボックスをオンにするだけです。

QFieldSync Preferences
QFieldSync Preferences

Copy the folder on your device. Open QField, open the project and start collecting data.

Also make sure to save the QGIS project using the regular Save As of QGIS as you'll have to re-open it later when you want to synchronize the changes.

プロジェクトのパッケージング中に、Advanced -> Directories to be copied でディレクトリをチェックすることで、コピーするサブディレクトリを選択することができます。

Select subdirectories
Select subdirectories

QFieldCloudを使わずにiOSデバイスと同期する方法

iTunesのファイル共有機能を使って、QFieldのルートフォルダにインポートしてください。

  1. iTunesアプリを開き、iTunesウィンドウの左上付近にあるiPhoneボタンをクリックします。
  2. 左サイドバーのファイル共有オプションをクリックします。
  3. アプリのQFieldを選択し、Add Fileをクリックしてください。ファイルブラウザが開きます。
  4. ファイルを選択します。

QFieldからの同期

収集した内容を同期する場合は、QGISでプロジェクト(通常の名前を付けて保存から保存したプロジェクトファイル)を再度開きます。

Copy the project folder from your device to your computer, and use the Synchronize from QField menu to synchronize your changes from the protable project to the main project.

Synchronize from QField
Synchronize from QField

Make sure that you synchronize your data back only once. That means, if you go out again to collect more data, you should create a new QField package before to avoid sync problems later on (like e.g. duplicates).