During FOSS4GUK 2019 in Edinburgh we ran a workshop for collecting data using Input. This is the content of the workshop with all the datasets.
To be able to work with Input, you will need the following:
For the purpose of this workshop, we have prepared a QGIS project. Let’s use that as a starting point:
The project you have copied in Mergin, is a QGIS project with various map layers. To see the content of the project in QGIS:
In Mergin, in the top menu, select Projects > My projects
Select foss4guk_YOURUSERNAME (or the name you assigned when copying the project).
In the top menu, click on the icon to download the project
Extract the content of the zip file
Alternatively:
The above process can be done through the Mergin plugin for QGIS. To do that:
Install the Mergin plugin in QGIS
Restart QGIS
In the QGIS Browser panel, right-click on Mergin and select Configure
Enter your Mergin username and password
Under My Project, right-click on foss4guk_YOURUSERNAME and select Download
Select a location under which the project will be downloaded to
Once downloaded, select Open to open the project.
Input is based on QGIS, therefore, any layer symbology / styles you set in QGIS, will be displayed in Input. If you are using SVGs (e.g. OS MasterMap), you need to embed these in the QGIS project.
Input also supports most of the edit widgets from QGIS. Edit widgets allow you to simplify filling-in forms with drop-down options, TRUE/FALSE switches, sliders, calendar and time, default values, attachments, value relations and more. To see some of those settings:
From the Layers panel (in QGIS), right-click on the listed buildings (points layer) and open the Properties window.
From the left-hand panel, select Attributes Form. Explore the various widgets assigned to different fields.
For this layer, we have set the Photo field to use an Attachment widget. This will allow Input to make use of your mobile camera to attach photos to features.
For the Surveyor field, we have linked it to an external CSV table, to populate a drop-down option with the names of surveyors.
Input can also use a pop-up window (similar to Google Maps) to display basic information about a single feature:
To customise this pop window’s content:
Open the properties table, and select the Display tab
You can see the title is set to ENT_TITLE and there is an image tag referencing the Photo field:
# image
file:///[%@project_folder%]/[% "Photo" %]
To simplify handling layer visibility, Input makes use of map themes defined in your QGIS project. In this project, there is a map theme for aerial photo (using a Bing aerial layer) and OpenStreetMap (geopackage).
[]{#anchor-5}Survey layer
In Input, any vector layer (point, line, polygon) can be edited (as long as editing that format is supported in QGIS). This could be very confusing when dealing with large numbers of vector layers in a single project (trying to figure out which one to edit).
Luckily you can set background layers (or those you don’t want to be editable in Input) to read-only:
In QGIS, from the main menu, select Project > Properties
In the new window, select the Data Sources tab from the left-hand panel
Below is the list of layers and their capability settings for the project. Layers not marked as read-only will be shown as survey layers (editable) in Input.
By default, the file paths to layers are relative. You can change that under the General tab of this window.
To use Input, open the app on your device. On its first run, Input will show the Projects page.
When you open the project, you may not see all layers. This is because some of the layers have zoom-dependant visibility settings (again configured in QGIS).
To switch map themes:
Tap More on the bottom-right side of the screen
Tap Map themes > aerial photo
You can also display feature details simply by tapping on them.
To capture data:
Tap Record
You can then choose the layer in which you want to record your feature, by tapping on the light green band, in the lower part of the screen, above the Input menu.
If you are capturing a point, by default, the suggested point to capture will be on your GPS location. You can drag the map to adjust the location of the new point. To switch back to the current GPS location, tap the GPS icon on the bottom-left of your screen.
After adding a point, you will be prompted to fill-in the form.
If you are recording a line or a polygon, you can either add points to define the shape of your feature or press and hold the GPS icon when in Record mode to generate a shape from your GPS track.
You can edit the existing features on your map. For point layers, you can edit geometry and form data. For lines and polygons, you can edit only the form data.
Let’s get out and capture some data for the Path layer!
Once you have made changes to your data, you can upload them back to Mergin:
In Input, tap Projects
Select My projects
Click on the sync/refresh icon to the right of your project
You can now download the project again to your desktop and see the changes in QGIS. Alternatively, you can synchronise the changes you made back to QGIS by using the Mergin plugin for QGIS (described earlier).