 Hello, this is Hans van der Krust, Senior Lecturer at IT Delft Institute for Water Education. In this video I will show you how to digitize vectors in a geopackage using QGIS. So we are going to create a geopackage with points, lines and polygons. We'll first start to create a layer with points, with all the peaks. So we go to the layer menu, choose create layer and new geopackage layer. Because this is the first layer that we create, we also need to create the geopackage database. So let's call it Mount Marcy. And then the name of the table, in this case there will be peaks because it will contain the mountain tops. It has a geometry, the point geometry. We will not use the Z dimension, we will just directly use the values for elevation. And we check that the right projection is chosen, which is the case. And we add an attribute with the name elevation, which can be a decimal number, a real number. And then we can add it to the list of attributes. By default there will be an ID number and then the attributes that we add. So we can also add other ones with text data or date and time. If you want to, for example, add the name of the mountain peak, we add text. So we see the peaks layer is added. When we hover our mouse over it, we see the location in the geopackage. And we can toggle editing and then we can add the point. So here's our first point, it auto-generates the feature ID. So we only have to fill in the attribute for elevation, so that's 764 meters. And let's look for another point, here we have another point. So we add another point, auto-generates the feature ID and we have to only type 738 meters. And let's take a third one. If you space in editing mode, we can pan by just dragging the mouse. Here's a third point, again it auto-generates feature ID and we type 1066 meters. So these are three elevation points. What we can do is we can save it, we can still edit it by moving the vertices. Here it's highlighted and then we can move it or we select it and move it back. And there's undo buttons and we can save. Once it's saved, it's stored in the attribute table. And let's open the attribute table and there we see our three elevation points with auto-generated feature IDs. So our first layer in the geopackage, our point layer is ready. Let's create a new one. We select the same database and we create a new table. That will be the one of the rivers, so we call it rivers or river. And it's a line, projection is the same. Name is the name of the river, so we call it name, in this case it's text. And we limit the length to 100 characters and then we add it to the field list. Again, automatically feature ID will be created and this will be added. Now this layer is a new layer so we choose add layer to the database. When we hover our mouse we can see the information of the layer in the database. Let's choose a nice river for digitizing. Here we have the slide book. We toggle editing and we start from the upstream to downstream because with lines also the direction is important. With this button we can add nodes for the line and we trace the river from the backdrop towards the downstream. You clearly see the effect of the resolution approximate. If you make a mistake you can press backspace, it goes one node back. Every left click you add a node. Now we're almost at the point where a tributary joins. We place a node there because we need it later if you want to add the tributaries. In that way the tributary will be accurately joined to the other river at the right spot. Now stop here, if you click right it will finalize this feature. The FID will be automatically generated and with the name we type slide book. Press OK and we see the thin line which has a random color in this case is not very visible. Later we will style it. Let's do the tributary. Again we start from the upstream and we go to the downstream. First of all we need to activate the snapping toolbar and set the snapping. Because we want really that the tributary snaps to the vertex that we have placed. We can change it from pixels to meters. We put it for example at 25 meters that's the tolerance. If we are within that distance we can test it here. We zoom to the junction. If I come close within 25 meters we will highlight and we will snap lines that we digitize to that point. Let's start digitizing tracing the river from the upstream to the downstream. Until we hit the tributary where the tributary enters the other river. There we go. We see that the other tributary joins there so we place a node exactly at the point where we want to snap the other one. We see if we come closer that it will snap to the dot to the vertex. Click right to finish it and then we type slide book again because this is still the slide book. Let's do the last one similar way upstream to the downstream. Try to connect or snap to the vertex that we place at the junction. When we come within 25 meters it will snap. We click there and we finalize it by clicking right. We also call it slide book. We save it. If you do this card it means undo everything that you did. That's in emergencies. Let's open the attribute table and we see here three feature IDs and three times slide book. If we want to consider the slide book as one we need to use the dissolve function which is a vector geoprocessing tool. There we go dissolve. We choose the reverse layer and we click these three dots on the side unique ID fields and we check the box at name. Then it will join every feature with the same name. In our case every feature with slide book will be joined into one. We add this to our geo package that we already have so we have all the layers together. It asks for a layer name. This is reverse but then dissolved. Then I run it and it's quickly done. Let's check the result from the attribute table and we see indeed that now there is only one feature. When I select the feature I see the whole river including all the tributaries becoming yellow. That means that it worked. Let's rename the layer to something that makes more sense so river is dissolved. Let's remove the other one. Okay and turn off the selection. Now let's do polygons. We're going to digitize the lakes. I choose some small ones just for demonstration purposes. Again the same procedure layer create layer create layer and then we choose a new geo package layer. We choose the existing database of Mount Marcy. Change the table name to lakes and for the geometry we will choose polygons. The projection is still the same and here we also use the name of the lake text data. 100 characters added to the fields list to the attribute list. When we press OK we click add new layer to add this layer also to the database. Total editing and there we can trace the perimeter of the polygon. If we place the nodes too close by it gives these warnings. That's not so problematic. So I can just continue. And when you want to place the last node you click right and it will be connected to the first node to complete the polygon. The ID is automatically generated and the name in this case we just make it Lake 1. Check in OpenStreetMap if there's a name of a lake. Now even there there's no name of the lake. So let's keep it Lake 1. Now let's move to another lake. Zoom in well. And the same we just trace. Remember when we do backspace we go one node back. When we talk editing we can select discard if we are not happy. That's a complete undo. There are also some undo and redo buttons that you can use. With space we can pan. When this one is completed let's call it Lake 2. And let's also do a third one. And we give it the original name Lake 3. Total editing we save it. And now we also can check this attribute table if we click right. Open attribute table and indeed we see the three polygons. Let's toggle here to editing in the attribute table. And we are going to add a column. I want to add a column for the surface area. So surface area in square meters. Which can be calculated using an internal geometry function which I will show you. And that will be a decimal number. Click OK. We choose here surface as an output equals and then name of the function. In the geometry we find these functions. Area will calculate the area using the map units. And we see a preview. So surface equals dollar area. When I update it I get here the surface area in square meters. In the same way we can calculate for the rivers the lengths of segments. And we can also add coordinates already. But I can choose their categorized. We choose the name column there. Choose classify and now every lake will get a random color. A unique color per lake. For the rivers let's give them a simple blue color. We do OK. Zoom to the layer clicking right. See the whole layer there. And now nicely in blue. And we can also change the style of the peaks. We can use f7 to see the life changes. I choose their all symbols. And give it a triangle. And let's make the triangle red. And we can also change the outline. Let's make it black. So red triangles with a black outline. Just some simple styling. We'll focus more on styling in another video. Now it would also be nice to have some labels. So let's label the peaks with the number of their elevation. And there we are. We see now the numbers printed next to the peaks. It's better to make them more visible. Create a little bit bigger distance from the triangle. And we can use a text buffer so they're even clearer to read. And what we can also do play a bit around with the labels. If we add things, we can concatenate text. So we add meters to it. And for the river, it would also be nice to have the name of the river next to the river. So we use also the label with the name. We see there in black slide brook next to the river. Let's change the positioning. We can make it curved. It's especially nice with rivers. It will follow the flow of the river. And there are all other kinds of options that we can set. So we can play around to see the effect. Change the font type and the color. Let's also make it blue. And there it is. This labeling is depending on the zoom level. So we see that it moves a bit. And if we remove the background layers we see here, our digitized points, lines and polygons, they're all stored now in the geopackage. You can also save the styles to the database. You can save it as a layer style or SOD, but we can save it also to the geopackage. And give the style a name and a description. And we can check the box to use it as a default style for the layer. And it will be automatically added when we load the layer. Let's do the same for the rivers. You also save the style in the geopackage to have everything together. And that's of course a big difference with the shapefile. We can have now points, lines and polygons together in one file, the geodatabase, including the styling. And for peaks, same. And there it is. Now to prove that everything is stored in the database I'm going to remove these three layers and add them again. So in the browser I go to the right folder and there you see the Mount Marsy geopackage. And I add the three layers that I want to use. Be sure to use the dissolved. And there it is, including the styling that we previously gave. So in this exercise we learn to georeference a scanned map and to use that as a backdrop for digitizing points, lines and polygons that are stored in a geopackage, including the styling.