GIS users are not always stuck at their desks, creating geospatial data and making maps. Sometimes field GIS data collection is a necessary part of the job. The broader QGIS ecosystem offers QField, a smartphone app that extends the capabilities of QGIS into the field, acting as a mobile companion that enables in-situ data collection and editing. QField was developed by OPENGIS.ch and released under a GNU Public License (GPL).
Using QField to synchronize GIS data collection with QGIS
QField is designed to seamlessly work with QGIS projects. This means that users can prepare a QGIS project, including layer symbolization, and then easily transfer the GIS data and map project to QField on their mobile devices. While out in the field, data can then be added or modified before being synchronized back into the QGIS desktop application.
What is covered by this QGIS and QField tutorial
For this tutorial, an area of interest (boundary with MB satellite imagery tiles) was defined in QGIS, covering the area where field data will be gathered. The MB tiles help to visualize the region of interest by using high-resolution satellite imagery. Point vector feature data was created for collecting the spatial-attribute information (name of school, website of school, and contact of school) for schools in the region of interest.
The Qfield sync plugin in QGIS helped to set preferences that guided the data collection tour after installing Qfield app on a mobile phone device. The mobile smartphone app (Qfield) was used for collecting the necessary data along with their attributes. After data collection, the Qfield app was synchronized with QGIS to visualize the data collected from the field.
Defining a geographic area of interest and preparing QGIS project files
- Open and create a new Project in QGIS.
- Save the project using the Save as command from the Project tab.
- From the Browser window, right-click on XYZ tiles and select “New connection” to import a Google satellite image base layer.
- Set Name to Google satellite and set the URL to https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}.
- Click Ok.
- From the Plugins tab on the menu bar, select “Manage and install plugins.”
- From the search bar on the Plugins window, type and search “Geocoding” and select Install.
- From the Plugins tab, select geocoding. A search window appears. Enter the area where the field data collection is to be conducted and click Ok.
A new polygon shapefile layer is created to define our boundary:
Free weekly newsletter
Fill out your e-mail address to receive our newsletter!
By entering your email address you agree to receive our newsletter and agree with our privacy policy.
You may unsubscribe at any time.
- From the layer tab, select “Create layer.”
- Select “New shapefile layer.”
- Set “File name” to boundary.
- Set “Geometry type” to polygon.
- From the “New field,” set “Name” to Name and click “add to fields list.”
- Highlight “Id” from the fields list and click “Remove field.”
- Click Ok.
- Select Boundary from the Layers panel and toggle editing by clicking on the light yellow pencil. .
- Click on “Add polygon” and hover the mouse over the region of interest to digitize.
- Specify name as boundary and click Ok.
- Right-click on the boundary layer from the Layers panel and select properties.
- From the “symbology” window, set the “symbol layer type” to outline: simple line and click Ok.
To create a point feature layer for schools in QGIS:
- Select “New shapefile layer.”
- Set “File name” to schools.
- Set “Geometry type” to point.
- From the “New field,” set “Name” to Name and click “add to fields list.”
- Highlight “Id” from the fields list and click “Remove field.”
- Set “Name” to Contact, type to “integer,” and click “add to fields list.”
- Set “Name” to Website, type to “text (string),”length to 400, and click “add to fields list.”
- Click Ok.
To style the school layer:
- Right-click on the school layer on the Layer panel.
- Select Properties.
- From the Labels window, select “Single labels.”
- Set value to name.
- Check the “draw text on buffer” from the buffer window.
- From placement window, set distance to 3.
- Click Apply.
Next, save a high-resolution image for our area of interest that will be a base layer along with the boundary layer during data collection:
- From the menu toolbar, select “Processing.”
- Select Toolbox.
- Select Raster tools and select “Generate XYZ tiles (MBTiles).”
- Set minimum zoom to 18.
- Set DPI to 300.
- Set Tile format to JPG.
- Set Quality (JPG only) to 85 and specify output.
To install Qfield sync plugin in QGIS:
- From the Plugins tab on the menu bar, select “Manage and install plugins.”
- From the search bar on the Plugins window, type and search “Qfield sync” and select Install.
- From Plugins tab, select Qfield sync.
- Select preferences.
- Set your “default packaging import directory” and “default packaging export directory.”
- Click Ok.
Installing Qfield on a smartphone and synchronizing with QGIS
- From Plugins tab, select Qfield sync.
- Select Qfield sync.
- Select “Package Project for Qfield.” Be sure to specify the same directory as the “default packaging export directory.”
- Click Create.
For this task, I used an iPhone for the field data collection although synchronizing a QGIS project can be done with Android devices and other cloud-based storage options. Visit the QF Field support documentation page for more help.
- I logged into my iCloud with my login details. From my iCloud drive, I created a new folder and uploaded all the field data files generated after packaging my project for my Qfield phone app; Google satellite, point school feature, and boundary.
- On my iphone, I installed the Qfield app from app store and moved the folder created for my project from my icloud into my Qfield working directory.
- From the Qfield app, I clicked “open local file” to access my project files and import them unto Qfield.
- From the schools layer, I toggled digitizing mode and began to select the schools over my area of interest (AOI). I clicked on the green plus to begin keying in details about the building; name, contact, and website.
- Once I was done, I copied the project files from Qfield directory from my phone onto the “default packaging import directory.”
- From the plugins tab, I selected Qfield and selected “Synchronize project.” I set the directory to “default packaging import directory” and clicked synchronize to import the project files back into QGIS.
The GIS data and attribute information collection in the field can then be resynchronized back with the applicable QGIS map project.
The GIS data I collected using QField now looks like this in QGIS.