Vai al contenuto

QFieldSync

QFieldSync is the QGIS plugin, which you should use to "package" your projects for QField, which means to make your project available for QField. It is also this plugin you need to use when connecting to QFieldCloud.

QFieldSync will do the following:

  • It packages your project into a 'QField readable' format (e.g. portable_project).
  • It (can) create(s) basemaps from a single raster layer or from a style defined in a map theme.
  • It automatically sets your project to "offline editing".
  • It is used to synchronize your changes made in the field to the Desktop project.

Procedura

Per avere una visione d'insieme del processo, riportiamo una lista dei passaggi principali:

  1. Creare un pacchetto QField. Si tratta di una copia di lavoro in una folder.
  2. Copiare il pacchetto QField sul proprio dispositivo.
  3. Andare sul campo e raccogliere i dati.
  4. Copiare i dati raccolti sul campo all'interno del proprio computer.
  5. Sincronizzazione dei dati raccolti con il proprio database o file.

Installazione

  1. In QGIS direct to Plugins > Manage and install plugins.
  2. Search for "QFieldSync".
  3. Select the plugin in the list and click on "Install".

QFieldSync in QGIS plugin repository
QFieldSync in QGIS plugin repository

QFieldSync Settings

You will prepare your QGIS project depending on your requirements and save it as a .qgs. You can save it in a dedicated folder and use it repeatedly.

Configurazione del progetto
Configurazione del progetto

Layer Packaging

Configurazione dei layer del progetto
Configurazione dei layer del progetto

In the project configuration dialog, an "Action" you can define the behaviour of each individual layer. 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: The layer source will be left untouched. This is only available for non-file-based layers like WMS, WFS or PostGIS layers

  • 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, this log will be replaced and all changes also be applied to the original source layer. There is no conflict handling in place.

  • Remove: The layer will be removed from the working copy.

Area of Interest and Basemap

When working offline, you have to add a raster layer or set a map theme to have a basemap when working in QField.

Note

The settings of this sections are not applicable when using QFieldCloud. Offline layers need to be prepared before the fieldwork.

Area of interest

When packaging your project for QField you can define an area of interest. When setting an area or a layer, only copy features intersecting this area of interest" will be 'packaged' when exporting the project to QField.

Basemap: A base map is a raster layer which is added as the bottom most layer to the packaged project file.

There are two possible options to set a basemap:

  • Single Layer: 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.

  • Map Theme: 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.

Tile size

The tile size defines the spatial resolution meaning the number of map units per pixel. Eg. if the map canvas CRS has meters as units and you set the tile size is set to 1, each raster pixel will have a spatial extent of 1x1 m.

Zoom level:

By setting the minimum and maximum zoom levels you define the level of detail that you will see when zooming in and out.

  • 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

Additional Properties

There are some more advanced properties options which may bw relevant to you depending on your domain:

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

  • Attachment default names: If you wish to save attachments within your data, you can modify the set default names. Please refer to How to configure your attachment path.

  • Maximum number of items available from a relation: When working with relations you can set the maximum number of items shown in the relation editor widget.

QFieldSync Layer Properties
QFieldSync Layer Properties

Configuring maximum items visibility for QField

Per regolare il numero massimo di elementi visibili in una relazione all'interno di QField, attenersi alla seguente procedura:

  1. Direct to Vector Layer Properties... > QField.

  2. Under "Relationship Settings" set the "Maximum number of items visible".

Note

  • The default number is set to 4.
  • If empty, the number is unlimited.

Maximum items visible for relation
Maximum items visible for relation

QField Visible items
QField Visible items

Confezionamento per QField

Once you are done with configuring your project, layers and styles you are ready to package your project.

  1. Direct to Plugins > QFieldSync > Package for QField or click on the according symbol in the QFieldSync Toolbar.

    Package the project for QField
    Package the project for QField

  2. Select the folders which also should be copied to QField.

    Select subdirectories
    Select subdirectories

    By default, QFieldSync chooses the filepath for exporting a project. It is however possible to change those defaults by directing to Plugins > QFieldSync > Preferences.

    QFieldSync Preferences button
    QFieldSync Preferences button

    In this window you can also manage whether the packaging options are shown in the QFieldSync toolbar.

    QFieldSync Preferences
    QFieldSync Preferences

  3. To start working in QField, copy the whole folder on your device. Check the Storage section for the directory specification, depending on your system (Android, IOS, Windows).

Tip

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.

Sincronizza da QField

Once done with your collection, it is time to synchronize the data with your Desktop project.

  1. Re-open the project in QGIS (the one you saved with a regular Save As) previously.
  2. Copy the project folder from your device to your computer.
  3. Direct to Plugins > QFieldSync > Synchronize from QField menu to synchronize your changes from the QField project to the Desktop project.

Synchronize from QField
Synchronize from QField

Attention

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).