QField for QGIS

The mobile GIS app from OPENGIS.ch combines a minimal design with sophisticated technology to get data from the field to the office in a comfortable and easy way.

QField is built on top of the professional QGIS open source project, allowing users to set up maps and forms in QGIS on their workstation, and deploy those in the field through QField. Leveraging QGIS' data providers - OGR, GDAL, PostGIS, and more - QField supports a wide variety of vector and raster formats.

Datasets can be locally stored or accessed remotely and synchronized with WiFi, USB cable or mobile network.

Get in Google play

Build

For Android

Quick and dirty

Use the dockerized QField SDK.

# get the latest tag from https://hub.docker.com/r/opengisch/qfield-sdk/tags/
TAG=20191001
cd QField

git submodule init
git submodule update

docker run -v $(pwd):/usr/src/qfield docker.io/opengisch/qfield-sdk:$TAG /usr/src/qfield/scripts/docker-build.sh --rm

This will put the apk into a subfolder build-docker/out/build/outputs/apk

Go the hard way

Build OSGeo4A

cd QField

git submodule init
git submodule update

cp config.pri.default config.pri
# Edit config.pri

The advantage of this is, you will be able to build and deploy directly from QtCreator.

For Desktop

To build QField for a desktop environment:

  • Get QGIS development libraries.
cd QField
git submodule init
git submodule update

cp config.pri.default config.pri
# Edit config.pri
  • Open CMakeList.txt with QtCreator (installed during OSGeo4A installation).
  • Hit build.

If you make your own QGIS build, use the following variables: QGIS_ANALYSIS_LIBRARY, QGIS_CORE_LIBRARY, QGIS_INCLUDE_DIR, and QGIS_PLUGIN_DIR.

On OS X

In addition to the steps above, in QtCreator's build environment (access via Projects > Build), add the following variables:

  • QGIS_INSTALL_PATH: the same value than in the config.pri (could be /usr/local/opt/qgis3/ or the installation folder of a local build)
  • DYLD_FRAMEWORK_PATH add _QGIS_INSTALL_PATH_/QGIS.app/Contents/Frameworks (replace _QGIS_INSTALL_PATH_)
  • DYLD_LIBRARY_PATH add :_QGIS_INSTALL_PATH_/QGIS.app/Contents/Frameworks/qgis_core.framework/Versions/Current (replace _QGIS_INSTALL_PATH_)

Invalid version number issue

If you get the error invalid version number in '-mmacosx-version-min=', you need to hardcode the minimum deployment target by setting version_min_flag = -m$${version_identifier}-version-min=10.10 in /usr/local/opt/qt/mkspecs/features/mac/default_post.prf.

One line command:

gsed -i "s/version_min_flag = -m\$\${version_identifier}-version-min=\$\$deployment_target/version_min_flag = -m\$\${version_identifier}-version-min=10\.10/" /usr/local/opt/qt/mkspecs/features/mac/default_post.prf

In Qt Creator > Projects > Run >

  • Check Use debug version of frameworks
  • Add a custom deployment step: _QField_SOURCE_DIR_/scripts/mac_deploy.sh with ${QGIS_INSTALL_PATH} as argument.
  • In Debugger settings, check Enable QML

Other issues

If you have any issue with qmake not finding the proper SDK, in /usr/local/opt/qt/mkspecs/features/mac/default_post.prf, replace $$QMAKE_MAC_SDK_PATH (3 occurences) by /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

GitHub