 My name is Hans van der Kras from IHE Delft Institute for Water Education. I'm going to show you in this video how to do a field survey using different open source applications, QGIS, the merchant platform and the input app. This video is based on a tutorial that is on our OpenCourseWare website. You can find it at ocw.un-ihg.org and then you go to the course open source software for pre-processing GIS data for hydrological models. There you can find it under the tab Field Service with QGIS, Merging and Input. The tutorial was developed together with Lutra Consulting who has developed the tools. The tutorial basically follows the workflow that you need. First, preparation of the project, loading background layers, setting up the forms, apply the styling and set the map themes. Then transfer of the project data to the Merging Cloud Service and then it is explained how to work with the input mobile app. When you are in the field using the forms, using the GPS and making edits and then synchronizing it back to the cloud service. You can download the data from this tutorial from this website. Let's first do that. We'll use here Sentinel-2 data and we're going to make a true color image and a false color image as a background for in the app. We'll use OpenStreetMap as a reference for topography using an online and offline version because we can be without network connection where we're in the field. Demonstrate how to use a vector layer also in the background. In this case we'll make a boundary of our study area and we'll make a survey layer. Let's download the file. I've unzipped it in a folder on my hard disk. Let's go to QGIS. If you go to the browser panel, I'll first add crop-napping folder that I made and where the Sentinel image is as a favorite. There it is. I can simply drag it to the map canvas. The first thing what we need to do is to style this one. This is a map stack and it has the layers 2, 3, 4 and 8 of Sentinel where 2 is blue, 3 is green, 4 is red and 8 is near infrared. But it is of course stored in layers 1, 2, 3 and 4. In the layer styling panel we can now set the proper pan so we want 3, 2, 1 for red, green and blue to get the true color image. This looks nice already but in other cases where you're not happy with the contrast you can change that by changing the stretching options here and changing the minimum and maximum values that it uses for the stretching. You can choose to stretch the whole range in the raster or to use the area that you're zoomed in on the map canvas. In this case we'll leave it like this. You cannot use this image as such. That would not be very efficient on the phone so we have to change it to an XYZ tiles file and we're going to create a so-called MB tiles file. Therefore we need a plugin. We go to the plugin manager and we look for the tiles XYZ plugin which is also developed by Lutra Consulting which has developed the merchant, cloud servers and the app that we're going to use the input app. So this plugin adds to the processing toolbox the tiles XYZ processing plugin and we have there generate XYZ tiles MB tiles. We click there in the dialog we choose for the extent, a layer extent of the original Sentinel image and we set the zoom level to 15. Y15 well it's an optimum between the resolution and the file size. I've experimented a bit with it so you have to do a bit of trial and error but in this case 15 works well. You can also see that we can put a range of zoom levels that will make the file bigger but then you can more efficiently zoom in and out so it's all a trade-off. For our purpose just one zoom level of 15 gives nice results. We keep the other things at default and we save it to our folder as Sentinel true color MB tiles file and we run the algorithm. There it is. In the browser panel we refresh it and we see there two files added and we add the roster with the MB tiles. We go back to our layers and we're going to compare the result and we see that indeed 15 is a good trade-off and there's not much loss of the resolution while it's still efficient in tiles. So we're going to repeat this whole procedure to create a false color image where we use a different band combination. So we go back to the styling panel and there I choose band 432 as combination where red is the near infrared which results in bright red colors for parcels with crops that are growing so real green parcels. So we choose again the layer extent from the original Sentinel. Put the zoom level back to 15 and we save this layer as Sentinel false color. So we have now two MB tiles that can be used in our project. We now no longer need the original Sentinel image. So we can remove that from the list. Of course, you're first going to check the result and also here we see that there's not much loss with the original. So we're going to now remove the Sentinel original map stack and we're also going to remove it from the folder because the whole folder will be in the end synchronized with the web service and with the mobile phone. So we don't need that file. We need to remove all the files that we don't need to be synchronized. Okay, the next step is to add an OpenStreetMap. If you go in your browser panel, you find OpenStreetMap under XYZ Tiles, which gives you access to the online web map. And this is useful to include in our app to have some orientation with the topographical map. Now that's basically all you need to do for the online layer. So I rename it to OSM Online. So it's clear that this is the online one because we're going to create an offline version for if we don't have internet connectivity in the field. And we do that in a similar way as for the Sentinel because we're going to create the XYZ Tiles, the MB Tiles file. First, we have to set the projection of this project to the web markator. That is because the MB Tiles use that projection. So set project CRS. The MB Tiles use it in this case to get the right extents. So in the Processing Toolbox, we choose Generate the MB Tiles. Take the extents from one of the Sentinels because we want to have the same area covered by our offline OpenStreetMap. And you see that it's projection 3857, web markator. And we put the zoom level also here on 15, which I tried with trial and error. And gave good results. So when we save that file to the MB Tiles, I call this one OSM offline, then the tool will just fetch all the information at the right zoom level from the server. That's completed. So we go to the browser and we refresh again like we did before. And we can now add the offline OpenStreetMap layer. So we have now an online and an offline OpenStreetMap layer. You can see that when we switch off the online one, we see that the offline one is fitted to the extent of the Sentinel images. And we switch back the projection of the project to the UTM that we'd like to use in this project. There are many other ways to add online maps. We can use, for example, the Quick Map Services plugin or use the other WMS services, for example. It is a good moment to save your file, save your project. And for our purpose, we need to save it as a QGS because that's the format supported by our workflow. Now, the next thing that we are going to do is to digitize the boundary layer of our study area. So we're going to create a new Geo Package layer to create the vector. And we call that Survey. That will be also the database Geo Package that we're going to use for the Survey layer that we create later. So the table name is Boundary. That's basically the name of the layer. Set it to Polygon. Keep the projection. And we don't add attributes because we don't need it. We just want a simple polygon. This is, of course, a hypothetical case. So I switch to Editing and I'll add just a quick and dirty polygon that we want to see in our app as the boundary of our study area. It's important to have a boundary of the study area because then in the field, you will not do observations beyond. You see that the feature ID is automatically generated. It's typical for a Geo Package or a database, spatial database. I'm going to change the styling. These stylings are also taken over by the app. So I'll make it transparent, make the polygon boundary red, and I'll make it a bit thicker. So we'll also be visual like this in the app. The next step is to create the Survey layer. That's basically the core of our app. That's where we are going to collect the data. So save the project and create layer. And we're going to add it to the existing Geo Package. So I choose that as a database, Survey. And for table name, we'll make it a point. And as table name, we choose their ground truth because this is our case here. We want to collect ground truth data for remote sensing classification. Keep the projection. And now we are going to create the attributes that we want for our crop mapping purpose. Here I use an example that comes from the FAO crop mapping trainings that we gave. So the first one that we need is an observation number. That's a whole number. We add it to the field list. Then the next field that we want is the observer name. It's always important to tag the name of the observer because people have different ways of estimating, for example, vegetation cover. And always, if you have questions, you can go back to the observer. You need an attribute date and time. It's very important to log the date and the time in the field. And that's a date and time data type, so that's easy. We're also capturing a picture in the field. And we tag that as text data because that's needed for the widget that we're going to create later. And I put the amount of characters at 80 that should be sufficient. We make an attribute land cover type. That's also text data, same size. Then the next one is the crop type, similar properties. Then what kind of water source is used in the crops? What is the irrigation method? We want to log that also in the attribute table. What is the coverage of the vegetation? There we want the decimal number. It's a percentage. It's a real value. And we add one on a size limitation of 300 meters. And that will be a checkbox where we have 1 for true and 0 for false. So it can be a whole number. And then we have finally some notes where we can write extra observations. We make that a bit bigger, 200 characters. So this is our attribute table. And because we add it to an existing geopackage, we click Add New Layer. So now both boundary and ground troops are part of our geopackage. So for ground troops, we can define a styling. So we add an extra simple marker. And we are going to style the first simple marker, make it a bit bigger. So it's very important that it's very nicely visible on the app. So don't make it too small and use some colors that you can distinguish. Probably it needs a little bit of exercise to get the right styling there. There are many options in QGIS for styling. And for the second simple marker, we use a cross. So what I want is a crosshair with a circle. So we really focus on a certain point, make it a bit thicker. Also for the first simple marker, you can change also the colors to blue, for example. There we are, styling. That will also be used in the app. Now the final step that we need to do here is to design the widgets. So we use an attribute form. And we can use their FID. We really don't use that as a widget. So we're going to hide that one. That's one that's automatically added. Remember, we didn't add that. But that came from the geopackage. So we put that on hidden. So we don't see that anymore. The observation number, that's the observation number that we can fill in ourselves. The alias field here is if we want to give it another name. But when the names are OK, we just leave it like it is. And as widget type, we choose here the text edit. So people can fill in the number. And we put a constraint there that it can't be null. So it has to be filled in. Then for observer name, we also want a text edit. And we also want it as a constraint not to be null. Then we go to date and time. It's recognized that it needs the date time widget, which is nice. And we're going to change how the widget displays, because we want the notation a little different. We want day, month, year. And then hour, minute, second. And we don't want the calendar pop up. And it should not be null. And a default value, we put dollar now, so we can get the current date and time filled in automatically in the widget. Then for picture, we choose widget type attachment. It's important that we set it to relative paths, because it's going to be used on the phone. And we're going to change the integrated document viewer to image. And we also want it not null. Then the land cover type is going to be set to a value map. And with the value map, we can basically code values to different options. So here we put different land uses. And in the app, you will, of course, have nice dropdown menus for this. So we also check here that it's not null. And we put the default value on one, because our interest is crop mapping. And the preview says already, crop land. Then we go to the crop type. Similar way, we also want to dropdown menu in our app. So we choose value map. And we fill it in with different crops that we have in our study area. Now we need a special constraint here. And we can put an expression there, because we only want this crops to be chosen if the land cover type is on crops. Land cover type equals. And then we choose one, which was the crops. So we can only fill this in when the land cover type equals one. That's what it says. And that's also taken over by the input app. Copy this, because I need a similar constraint later. Go to water source, also value map, and similar constraint. Then go to crop irrigation method, also value map. And there we also have the constraint. But we add an extra constraint to it. So of course, land cover type needs to be one. But water source needs to be two, that there's irrigation. So only if both criteria are true, then we can fill this one in. We will add coverage, which is the vegetation cover. We can use an alias for this to make it clearer in the table what it means, also in the app. And we can use a widget here for a range. And use a special one, the slider. Not all these widgets are supported by input. You'll see later that this one is not supported yet. They're working on these widgets. We put it from 0 to 100 with step size of 5. Then there's the size, which is a minimum requirement to indicate for the parcel if the field size is big enough, which is larger than 300 by 300 meters. And we use a checkbox. And when it's true, it's checked. It's yes. And when it's not checked, it's no. There it is. And the last one, the last widget is for the nodes. It needs to be a free text field where we can use multiple lines. And that's it. So this is our field form. Let's check in the attribute table how this looks like. Now, the final thing that we need to do is to set the boundary background layer to read-only. So the background factor layers need to be set to read-only. And the ground truth, of course, needs to be edited in the app, so that's not read-only. Based on this, the app can identify the survey layers because they are not read-only. The other thing we need to do is to now define the map themes. Map themes are basically presets that you can define in QGIS to a fast visualized combination of layers. So the first one is Sentinel True Color, where we have the vector boundary polygon layer and the True Color Sentinel activated. And, of course, the survey layer. And we make one now for the false color. So we uncheck the other things. We have the false color there with the boundary and the survey layer checked. So we call that one Sentinel False Color. And then we create one for the OpenStreetMap offline and one for the OpenStreetMap online. Now, you can check it by just switching between these different map themes and see if it works like we want. So this is offline. Then we have the Sentinel False Color and the Sentinel True Color. So in this way, these map themes will also be used in the app. We save the project. Now we need to install the Mergeant plugin, which links QGIS to the cloud service that is called Mergeant. And Mergeant is also developed by Lutra Consulting. So that will add in the browser panel Mergeant folder. And there you can configure your credentials and the link to the server. And once you've done that, you can check all the projects that are on the server or my projects. If you already have some projects, you'll see it there, like in my case. And if you have a new project, click right and you can choose Create New Project and type the name. So we call this one Crop Mapping. It's a public one. You select the folder and then it starts synchronizing this folder with the cloud service of Mergeant. Mergeant project created successfully, so that's great. So we find it under My Projects. You see there are clouds, so it's also in the cloud. And when we go to the cloud, we sign in. Then you can find the project Crop Mapping. And your personal projects. And here are all the files. So the next step is to synchronize this with the input app. You can install the input app from the Google Play Store. And I've already installed it, and this is a previous project. But after you're logged in, you can see your own projects. Under My Projects, you see your projects. And there's the Crop Mapping project, and we downloaded it from the server to synchronize it with the mobile phone. And then under Home, we can tap it, and it will load. First time it takes a bit, and in the future it's caches. And we see that the GPS signal is green, although we are not in this region, in this demo. We can tap Polygon, the background Polygon of the boundary, and it gives us the attributes. Not so interesting here. And we can switch map themes. Switch to the OpenStreetMap offline or online. Very useful when we are navigating in the area. And here's the map theme, where we have the Sentinel false color. That's useful to identify which parcels are vegetated. These are in bright red, because they're near infrared. And we can choose the true color, Sentinel. When we want to add a point, we tap Record. Now it will move to our GPS location, which is very far away, because we're just simulating this case. But when you find back your place, you can tap. Move on the spot where you want to place the marker by moving the map around, basically, with your fingers. Once you've found the right parcel, you tap Add Point. And then you can fill in the observation form that we designed in QGIS. If you click the Date Time button, then it will fill in the current date time. You can add a picture, and you can choose here what the land use is. In red, you see the fields that are depending on the answers of the other fields. So if I choose here RainFed, I cannot fill in the irrigation method. Type in the vegetation cover. The slider widget is not yet implemented. But for the field size, we have the toggle that is implemented. And we can make some notes. And then when we are satisfied, we do Save. And the point is placed on the map with the symbology that we've chosen. If we tap the point, it will give us a quick preview of some attributes that we chose. And we can now still edit the form. So let's change the irrigation method to Sprinkler. And then it's saved. And then the final step is to synchronize this back to the server. So if I go to My Project, you see the Synchronization button, and I can synchronize it. So in this tutorial, I've shown how to use QGIS, MergeIn, and the input app to do field surveying. If you want to know more about QGIS, then visit my open courseware or come to IHC Delft for a short course. We can also organize tailor-made trainings. If you want to see more videos, please subscribe to my YouTube channel.