 Okay, welcome everybody at this fourth QGIS Hydro webinar and really glad that you are here and found a subscription button apparently so Yeah, we had about 110 people subscribed and I think some more will enter we're currently with 42 people in the meeting Please keep your mics muted and your camera off until we are at the Geo beers If you have any question, please put it in the chat also use the chat to introduce yourself your name your country your organization anything else You want to share and feel free to ask the questions. I'm gonna switch to to the presentation So hope you can see my screen. We're in the fourth QGIS Hydro webinar And yeah, we really hope that you are surviving in these covert crisis times and we really hope that you find these things useful and hope that you You enjoy learning new things or extend your knowledge on QGIS So I'm a huntsman from the crust and I'm a physical geographer background. I Studied physical geography at Utrecht University there I also learned a lot about GIS and I did my PhD there on the integration of satellite imagery in Soul moisture modeling using data assimilation techniques I started using Python there and the PC Raster Python framework one of the first testers of it It's a great tool for met algebra that we covered last time It's now integrated as a as a Python library and hopefully in the future. We'll get all those tools in QGIS Then I was a researcher at the Flemish Institute for technological research in Flanders the northern part of Belgium Where I was working for the environmental modeling unit and we were very happy to switch to open source There are lots and we even had a nice working group on Python and shared the knowledge with each other and I was working there on water quality models lent use change models and in the unit We also worked on air quality, which seems to be improved in the last weeks for some reasons Since 2012 I work at IHE Delft Institute for water education. It's one of the largest educational institutes on water in the world where we have students from all over the world doing masters And I'm a lecturer there in ecological modeling but most of the times I'm working on GIS and remote sensing and Python and I'm also a board member of the Dutch QGIS user group. It was established at the end of last year and it's great to have now a community in the Netherlands and Yeah, we will also keep them posted so you'll have to do some things online also these days my main interests are open source GIS and modeling and Like Kurt, I'm a QGIS certified instructor Which means that for every course that you follow with me you can get the QGIS official QGIS certification which donates per certificate 20 euro to QGIS so they can improve the software and Yeah, you have an official certificate and our organization likes it to support of course QGIS I'm very happy that IHE Delft likes to support QGIS We also have a big group on Remote sensing for hydrology also one of my interests For water accounting and water productivity very important tools a lot of open data that we process to get water balance parameters in my project work, I work a lot on spatial data infrastructures or SDI and I'm Advocating a lot for open data, which will be the topic of next webinar Because it also integrates nicely with QGIS and we have some very nice examples to show you and Yeah, as I say every week we always think that we are a bunch of nerds behind the desk. Well, we are in the corona times, but Normally we also like field work and it's very important to know Yeah, how data collection goes on in the field and how to process that data and Understand the data that comes from the field. So these things go together quite nicely If you want to contact me then you can send me an email or Connect to me on LinkedIn Look at Twitter or on Instagram and watch videos on my YouTube channel. They're all about QGIS and Python, etc So give the word to Kurt Menke Hi, everyone. Great to be here today I Run birds. I view which is my own consulting business in Albuquerque, New Mexico, USA I also have teamed up with Several core QGIS developers and trainers and we call ourselves the Q cooperative and our goal is to provide QGIS support services. So if people need Custom plugins or new features in QGIS or QGIS server You can contact us there. I also run a Program called community health maps, which I'll talk a little about at the end of the webinar after Hans is done And I do a whole mix of things I do a little spatial analysis and cartography and some teaching so I wear lots of hats as they say and I've written Six different books on QGIS at this point, which is hard to believe that the most recent to discover QGIS 3x Which is a big 400 page workbook Which is a really thorough treatment of QGIS with 32 lab exercises in it And then this book which is the topic of this webinar QGIS for hydrological applications both of those with locate press and I'm also as Hans mentioned a QGIS certified instructor and Generally a strong advocate for open-source geospatial in general. I'm a Always I helped revive the QGIS US user group a couple years ago. So I'm a member of that so if there's Americans in here that want to join that you can hit me up and get on the mailing list if you're interested I'm also an Osgeo charter member and my contact information is at the bottom I have an email at birds. I view and an email at the Q cooperative and I'm on LinkedIn and geomenchi on Twitter so looking forward to the webinar and I'll be Helping on chat if you have questions as we go through this. I'll try to keep up with all the questions as they appear Great. Thanks Kurt So this is a series of seven free webinars and they follow each chapter of the book QGIS for hydrological applications published at locate press and You can find the link to to the book page at the publisher on the bottom of the screen It's easy if you want to do these webinars to have the book next to you and to to follow all the steps or to exercise after the webinar The first one was about preparing data from hard copy maps, then we went into importing tabular data into QGIS and The third one the last one was about spatial analysis with map algebra and Today we're going to dive into stream and catchment delineation. That's like the masterpiece for hydrologists and I'm eager to show you how how that works And next time we're going to talk about open data as I already said and then in the sixth webinar We are going to calculate the percentage of land cover per subcatchment and some other great tools of QGIS will be demonstrated and then we will have the Final webinar or map design where Kurt will show us all the tips and tricks of styling power of QGIS So I'm also really looking forward to that one and I'm very happy to have you all here So from time to time I have to admit people in the waiting room from the waiting room in that's the the only disadvantage of this setup Just have to deal with that I just fear to open it up for all So for today's topic stream and catchment delineation I'll just talk you a bit through the workflow the full lecture is also online in one of my videos I'm not going to give a lecture on the theory. You can you can watch that Of course, I'm going to mention the useful things during the practice So it all starts with downloading dm tiles left to mosaic them together, which means merging to reproject the tiles because you cannot not do dm analysis with The geographic coordinate system with latitude longitude coordinates Then we're going to subset the dm because all these tiles might not cover Only your area but much more and these algorithms that we use use quite a lot of calculation power for laptops and your computers Then sometimes you need to interpolate voids. These are missing data in your dm Sometimes happen in our case. It doesn't but I'll show you Where to find that and Then we're going to fill the things these are depressions in your dm artifacts That we need to get rid of for hydrological analysis because all the water in a catchment needs to flow out to the outlet Then we're going to burn in the stream network if we have a stream network in our case We're not going to do that, but I have a video about that That just ensures that your water will follow the existing stream network when you're going to delineate the catchment calculate the flow direction and Then we derive the streams Define the outlet on those derived streams because we're making a model and Then derive the catchment And then whatever you need to do with your delineated Streams and catchment convert it to the dataset for your hydrological model or make a nice map That's what we're going to do in the seventh webinar. So that's the workflow. We're going to follow today And yeah, I said the final map will be made in the in the seventh webinar But today we also show a few of those things Based a bit on the time and here on the right side It's also what i'm going to demonstrate is a nice tool that we developed with lutra consulting during the last headfest in akarunya It's a tool to convert the flow direction that we get out of the saga a tool Into a mesh and use the mesh dialing options to get these nice arrows to To show the flow of water over your terrain. That's really nice Okay Let's go to the practice So i'm going to switch to qgis. So we're here in qgis and it all starts with downloading your dm tiles and one way Of doing that, but in my case didn't always work, but i'll still mention it. I have a video where you see it working that is the srtm downloader plugin Which simply downloads all the srtm tiles in your map canvas. So the area that you're zoomed in at uh, very useful and it uses the Credentials that you also have at the earth explorer website. So i'm going to show the other method in earth explorer So earth explorer is from usgs and that's the place to find a lot of useful data and There are different ways of using the tool i made a little video about that on how to find a certain area The simplest way is just to zoom in on your area. This is a very nice agricultural area, by the way, tested Nice setlight image and you can say use map and it simply uses the boundary Of your canvas and you can use that then as the search area. That's one way Another way is to upload a kml or a shapefile And if you want to use a shapefile Then you can upload The zip bounding box and that will then give you the area As shapefiles, you know, it's not just one file. Therefore, we also promote a lot of geopackage But you can't upload here a geopackage So you need to zip your shapefile before you can upload it to this site. Then you go to data sets And uh for DEMs, you just choose here digital elevation You go to srtm And you check the box srtm one arc second global for the 30 meter data set that has been Available for the whole world since 2014, but the data has been collected around the year 2000 with space shuttle You can also check those other options when you download data. It's always very important to look at the meta data So if you click the information button, you get a lot of information about the data Okay, I prepared this of course, we're not going to download here a lot of tiles So it will take too much time and we need our time. I also created a favorite already I've demonstrated in the last webinar how to do that so This is from the book chapter and we see here the four tiles To go to a layer properties, then I get some information about these tiles. I see the projection. It's the geographic projection that's to longitude And give a minimum a maximum value of With the layer And that's available for all these tiles and I'm simply going to drag them into the map canvas and there we are So that's another way of downloading it. You can use the srtm download a plugin that will download the tiles for this canvas It's just a different file format, but that doesn't change the workflow. It's the hgt files And guess this one will add From earth expiry you get the geotifs So it's good to see where we are. So the quick map service plugin Always it's nice to use to see on the street map and We're doing this classic at least for my students classic catchment of the roar It's very nice for education because it has some nice issues that we're going to talk about these spots here and then the first step in our workflow is to mosaik all these tiles So we do that under the wrestler menu and there are different ways of doing it But here the most efficient way if you have tiles Of big files is use the build virtual raster tool Because then we don't really create a big geotif already, but we use a virtual uh layer I have to select all these layers except the open street map And I'm going to click okay You don't change this because they're all the same. We have to uncheck this box. That's very important We use this for remote sensing images put each layer into A band in this case. We want it in the space to be merged. It's very important then The only thing we need to do here is to save the file And go to the right chapter here chapter four This workflow is also very sensitive to file names and folder names to make sure you use underscores and no spaces and no strange characters. Very important um So i'm going to save this as the mosaik Then i run the tool And that's pretty fast because it's virtually mosaik sit and um oops There it is And I always like to keep uh the layers panel clean. So i'm going to remove those layers. So we can't choose the the wrong ones And the next step that we need to do is to uh, well, there are two things that we need We need to reproject to A metric projection because the z units of the dm are in meters Well, the geographic coordinate system is in latitude longitude in degrees And the other thing we need to do is to clip it to our study area, which is much smaller. I can show the the bounding box Here that's the bounding box and We're going to work in utm Zone 32 north on wgs 84 projection. You can always see those previews and choose the right one for your task this is a This is a trans boundary dm. So therefore I don't use a national grid, but I use utm dm is a Combination is a is a term for a digital elevation model Which can be a digital terrain model Or a digital surface model in a digital terrain model It's just elevations of the terrain in a digital surface model We also have the objects on the terrain So when you see this very high resolution Elevation, that's a digital surface model often But in our case, we we have a raster of 30 meters and we are interested in the general flow of water And therefore we can consider this more as a dtm where over the 30 meter pixels the elevation is averaged out So there are different ways of clipping the the raster and reprojecting I'm going to merge this in one easy step So that's the the difference the difference with the instructions in the book So what you can do is you go to the dm layer you click right and you use the export function and you do save as And there I can give it a file name and there I'm going to call this dm clip And Reprojected because I'm going to do it in one step. You see that I use intuitive file names So it's kind of can fall back on on the steps That's important because in in GIS you don't have undo generally only for things that work in memory But each time you save something so if you give it a good name, then you can find it back where you went wrong to trace back Here I'm going to use the coordinate reference system of the project which is the same as the bounding box If you hover your mouse over the layers not while I'm in this window, you can see the projection I'm going to calculate it from the bounding box the extent And I'm going to fix the resolution to 30 meters The SRTM one arc second product has a spatial resolution of one arc second Which is approximately 30 meters on the equator so degrees minute seconds and the seconds is then Well, one degree is 111 kilometers on the equator or one second is about 30 meters on the equator so choose that And for the rest I can keep it as default except the last one no data values. I'm going to add here with the plus An out of range value and it's a bit of convention to use minus 9999 And that's all what I need. Why do I need a no data value? You can see that The bounding box is rectangular But the dm is in another projection and it's cute So rusters can only be square in the end after read projection. So I have to fill up other parts with with no data I'm going to click okay It's a processing and it's below the bounding box And if I switch off dm then we see here that is clipped and if I hover My mouse over it. I can see it's in the correct projection. I can also see the file name So that went well, then I removed the mosaic. We don't need that anymore So here the next step is for hydrological purposes is to To make this hydrologically correct because there are a lot of depressions in what you can also have is that there is voids those are Areas that have no data values. We don't have it in this case, but I'm still going to show you that So I'm going to open the processing toolbox and if you have voids which are no data, then You can spot them by putting a very dark Grayscale or some styling on your dm and The parts that you can see through are the no data values. There are also other ways to to check that So I'm going to search here for no data and there's this function fill no data And then you choose the dm you can play with these parameters and they will do it. I have a video on that In this case, we do something else. It's called filling the sinks And that's a typical hydrological thing that you need to do There are artificial depressions in raw dms and the water gets stuck in it. It doesn't flow to the outlet The other thing is that it also removes the real depression So if they are important in your studies, then you need to put them in again And then a very efficient algorithm is the fill sinks Wang and you algorithm So, um, make sure that you choose the right dm. Therefore, I throw away the ones that I don't need Uh, give it an output name and save it to a file and I call this dm filled And you can also output flow directions at this point But I'll do that in a later stage and also the watershed basin is not near that is moment. I'm just interested in the In the filling of the sinks, then I run the algorithm It takes a bit. You need good computers for this 16 gigabyte memory is recommended and then still it can take some time and If it doesn't work, you simply do it again can happen. It's probably memory issues But this part's also very sensitive to to spaces. I don't have that in this case And when I rehearsed this it also gave the the error normally it doesn't Of course, I'm multitasking quite a bit now with other software. So hope resources are sufficient. Otherwise, I'll Take the one that I prepared already See it's getting a bit slow Always a good moment to to get a coffee when you push the button to calculate this Seems to be working now Yeah, there it is our patience is rewarded So this is the filled dm and if we compare it with the original one and then we can see that That the pits are filled and that's most clear at this point here where we see on the over-street map that there's a big open pit mine Really huge and I have a video where I demonstrate how to use the profile tool, which is very useful I can I can quickly show that to you So there's the profile tool You can install and that's to simply make profiles in QGIS And here click on it and I'm going to add layers Click add layer here. So add the other one the original one Change the color. Let's make the filled line green Okay, then I can simply draw a transect here And you see the red line was the original Pit that we have in our dm and it's now filled up So double click you end the line You can also open a Vector file and you can save it as a png lots of options here And you can see it traces live where you are on the profile So very useful tools you can have you can modify the x and y etc It's a really cool tool, but that's what the fill sinks algorithm does Then it's also nice to style the layers a little bit Always good to see that a few times. So I'm going to style this filled one Go to the layer styling panel and I'm going to choose a single vamp pseudo color And you see default You should not keep this it uses red to blue where blue are the highest areas which looks like lakes So that's not intuitive but if you Click right on The color ramp You can choose here create color ramp And I can choose here cpt city and then you get a lot of nice presets that can help you So there is a nice preset option for topography There are some nice choices here and I'm just going to use this one with elevation And now we have the elevation one And I'm going to show you a few more little tricks in that before we continue I'm going to duplicate that you have learned that also in a in a previous webinar and This one I'm going to rename Because I'm going to use this for the hill shade And you don't need to calculate hill shade. There's a nice renderer for hill shade. So Choose here hill here hill shade And you can even change the rotation or the the orientation of the sun And this is what it produces now if we combine it with the dm and then use the other nice trick to Use blending mode and choose multiply We can then get this very nice effect So that's that's nice. Another nice trick is You you have to play a bit because the southern part of this catchment is is having valleys and Hills, but the northern part is quite flat and if you want to see contrast there there's this trick here to use The current canvas and it will then If we move it it will then update it for for that part of the canvas If we use updated canvas it updates it every time and You see here it stretches the colors and if we wouldn't do that it will use it for the whole raster and That's not working. That's funny Probably do something wrong here. Normally it works Anyways, this used to work Probably not in a live demo So try that yourself I'm going to continue with the procedure. We have now a styled dm I'm going to zoom to the whole layer And the next step is to calculate the so-called strala orders. There are two ways to delineate your streams There's to look at flow accumulation, but uh, I have another video on that to use the grass tools here I'm going to use strala orders, which is more intuitive way a nice way to do that Saga has a nice tool for that So make sure you use the filled dm And you simply save it as a strala order File strala Save and I run it It is indeed a bit slower because I think the resources of recording the the webinar and the powerpoint open that should work So the strala order is a method to uh to order your streams It starts with the smallest upstream Pixels and then it starts When they come together you add the order if they're from the same order and if they're from different Order, you don't increase the the order. There's a nice video explaining that on my youtube channel um I'm gonna style it So as we discussed last time for these rusters, it's very important that you realize if it's discrete continuous or boolean well strala orders are Yeah, what are they? They are discrete, but with a certain order. So it's on an ordinal scale as we say so i'm gonna style it And for um discrete rusters and also for ordinal we use the palleted unique values option And because we have here a water I choose blues For the ramp and then I click classify It classifies now the strala orders from low order to high order with higher blue intensity As I want it goes from strala order one to a maximum of 11 Um, some people think there's a maximum value. That's that's not always that's not A standard so it just orders it until it gets to the max So there's not always 10 orders or 11 orders just simply depends on the extent of your area and the ruggedness of your area So we have now the strala orders and now the trick is to choose a threshold value for which orders and higher than that order we consider as streams and you do that a bit with trial and error calibration and uh Therefore i'm going to use the ruster calculator like we learned last time. I'm going to create boolean maps So i'm going to calculate first strala order larger equal than let's say five So i'm going to save it call it strala five Make sure that I remember which one has which threshold value And this uh equation remember it means if the pixels In strala have a value Five or larger than the result will be one for those pixels boolean true Else it will be false boolean zero So calculate that pretty quick And uh, then I need to style it So boolean as we learned last time is like a discrete layer. We use pelleted unique values I click classify and it finds that we have these two values in it And uh, I want it as blue because it's water And I don't want to see the zeros. So i'm going to go to transparency and I add here The zero as an extra no data value and i'm going to hide the dms And the exercise now for the calibration is to compare If this strala order larger than five is representing well the rivers on this map And the best way is to go from uh upstream to downstream because these algorithms work better in the natural condition But we see that this is far too many much more than we Would expect So we need to increase the order a bit So i'm going to do another one. I'm just going to do two for this webinar not Normally you try many and you search for the best one. So i'm going to do larger equal than eight Save this I'll call it strala eight Yep made a typo there And I run it And there it is And I can copy the style and it doesn't copy the transparency. You have to manually do that So to add here the zero value There it is So the difference between eight and five is quite high. So you see here This is with five six seven added to it And this is only eight And what we can observe is that in the natural areas it follows quite well the streams even where these reservoir lakes are are human made Then in urbanized areas you can find these kind of things where the the river has been confined and channelized that follows it less And here in this mine and that's of course because of the filling algorithm We see that the river just cuts through the mine To reach in the empty outlet because the water in the algorithms are forced to to the outlet To the lowest point in the DM which is around remont where the rural river gets into the most Okay, that's then also the the next step What we need to do is to To delineate those streams And we use there for another tool channel network and drainage basins tool also from saga And that one needs your elevation So make sure you choose the filled one And it uses this threshold value of strahler. So let's use here eight Then in this case, I want the flow direction. So I'm going to save that And I am not interested in the flow connectivity the strahler order we already had The drainage basins are here twice And what you need to find out is that this one is raster. You only find out when you're going to save it And the other one Is vector is polygons See so therefore it's here twice. So I'm going to Output not this one. I'm going to output the channels. So it's basically converge your strahler eight or higher to To to your streams, I'm going to call this channels So we'll be nice vector file. I'm also going to output the drainage basins These are all the basins in the dm that it can find just based on On the flow on the flow direction Just call these basins And I don't want the junctions To switch it off. They're all calculated the ones you switch off are not Outputed to to the screen and are saving temporary files. So I'm going to run it There we go takes a bit it will Run multiple parameters and then output the things that we requested Gives quite some feedback while you run it. You can see if things go go right And there it is I'm going to close it It was another lesson last time. Don't believe legends that automatically come out of your gis software So we're going to do a little bit of styling And let's start with our Channels, so I'm going to Layer so here you see the basins layer in brown. That's just a default color And it simply divides our dm in basins in catchments or watersheds And uh, we can already see here the roar catchment But we're going a step further what we want is for a specific outlet to delineate the the work catchment So I'm going to hide that one And then here are our channels and I'm going to style that And before you style it, it's always wise to look at the attribute table and we can learn a lot from that So what this tool outputs is several attributes several fields We have here order and order cell and the length of each segment And order cell is the strahler order that was taken from the raster. So I said larger equal than eight So it will have eight until 11 This order reclassified them So eight becomes one nine two, etc And that's the strahler order that you want to visualize on your map for the end user So that's the one we are going to use And we use there a categorized no a graduated styling And um We are going to use the order column and I put the precision here on zero because it's a discrete integer numbers and I'm going to uh, not use the color method but the size method So that they're going to play with the the thickness And we're going to use here a size from zero point three to one point zero and then uh, I can I want to change also the color to to blue Can also use a rgb value So a nice one from the book It's a 15 And 66 and 220 You go back And then I click classify and we still need to Use the amount of strahler orders that we have so I can play here with the amount of classes So I have eight until 11 eight nine 10 11. So four classes To to put here to write class boundaries This one should be three And then one should be four And we have four classes and different sizes so that it already looks nice Then we can also style Our flow direction map that's an interesting one And the flow direction map there was something I always wish to have a good styling for because You can't simply assign a random ramp to that or a gradient a linear gradient And court was uh, it was very helpful in book to to completely write out that part that I think nobody did before And uh, the key is that we have here the compass directions and something I want to tell you if if you work with These kind of tools um to always google how your software Works with it. So different software uses different encoding for flow direction, so If you want to look for something you start your search with qgis and you see I already wrote it flow direction legend And normally you end up then at the stack exchange website And uh, I asked this question some years ago and uh Yeah, then somebody who's not very helpful says check to read the freaking uh documentation as if I didn't do that But it's not well documented. You can't find that um So fortunately, there was somebody very helpful there Uh, christine and uh, this person told me That for saga is encoded in this way. So zero north and then clockwise and uh for grass It's like this and our gis does one two four eight, etc PC rusters you uses the arrows on your numeric pad. So it's really important that you know how the flow direction is encoded and use of the compass directions and um, so we need to style this but not with the normal, uh gradient ramp So i'm going to these are discrete values. So we use pelleted unique values And uh, i'm going to use here, uh The spectral ramp just as a starting point Click classify and there you find the value zero to seven and 255 255 is uh is for flat areas like minus one in in arc gis And uh, now I want to modify this Um, this ramp in such a way that we get a circular ramp So i'm going to click here and then we can edit The ramp i'm going to first remove by the way the 255 and add that in later so, um Now I can modify The ramp and you see here four different five different stops. So that's Uh goes clockwise north east south West and back to north And I can here change the color of the first one to the last one to make it circular So if I click here on the color, I can use here the the color picker And I can sample, uh, then the color to click it, of course And then that one will be assigned here to the first one So we've said that and also the idea to make it intuitive is to have a warmer colors towards Where the sun gets on the on the hills and that's on when they're exposed to the south or flow directions to the south aspect and flow direction very similar algorithms Almost the same actually so i'm going to use the the colors that were recommended by by curt So we're going to use for south yellow So i'm going to click this and then I can put here the yellow in So now it's completely yellow then for east i'm going to use uh green And that is simple simply r on zero green on 255 And then blue on zero And then we use for west we use magenta There we have 214 60 And 170 And this gives us a nice ramp that is circular so do okay, then it's applied And I need to add in Back the value 255 Which is Flat so you can you can type the compass directions here. I'm not going to do that for the sake of the time You can play around this with this to to make it better. You can blend this with other layers and this Makes it a bit more intuitive But there's something Different that you can do and that's also what I want to show at this point is to use the the crayfish plug-in to style this raster and See already that My computer's quite busy. So i'm going to make a subset first so you can also see that um I'm going to uh make this flow direction map a bit smaller clip raster by extent And i'm going to use Select the extent on the canvas and i'm going to to select an area which is here And uh, we'll use here No data value just to be sure and i'm going to save it to Flow there Click save run Okay, now have a smaller version here and i'm going to use that one with the crayfish plug-in So here in the plugins crayfish has has been made by a lutra consulting to deal with mesh layers and when I saw how nice it was Dealing with visualizing these meshes with with even arrows I thought that it would be nice to have that for the flow direction and during the hackfest in Acronia the name of this QGIS version by the way We made it together in a few days So you can find it then in the processing toolbox The crayfish plugin is here with a tool And we're interested in this conversion tool saga flow to grip I double click on it and here's our clipped file and it saves it to a mesh format a grip file And i'm going to call this flow there grip I'm going to run it Takes a bit and just change it to a different format and it doesn't automatically open So what i'm going to do is get it from the browser panel need to refresh it And there you see with this symbol that it is a this one is the the mesh layer I'm going to drag it there. It takes a little bit to load and then it offers us all these mesh styling options There's a nice video also Showing this there it is We need to tweak it a bit. So I'm going to Style it. So when I click here the layers panel adapts to the to the mesh option because it recognized this is a mesh And I want to switch on the arrows I don't want to show the contours and I want to Show the factors In a nice way. So I still need to do a few things here. So I'm going to zoom in on the area to just have a look I'm going to Hide here all the layers except Um It would be good to have the dm under it And you see that the density of the arrows is is a bit too too high So we need to to modify this first. I want to put it to a fixed length and We can play with these these values these the length is far too high so put it on on 10 And it starts adjusting now here. We see the arrows. We can still make this a bit smaller to 0.1 and Let's put this one on 20 maybe Five here now it becomes more visible as arrows in the flow direction But a better way to display it is to use these factors fixed on a grid there And that's really a nice tool and you can change the spacing of the grid. That's also very dependent on your zoom level So if you put them wider apart and on a coarser level, it's clear So that's a very nice way of visualizing The flow direction you have to play with this is in a live demo a bit hard to to fix all these things, but You can already see the effect and if I put the channels there in then you see that the water flows generally to To the channels what it should do Very nice this okay, um Then we are not there yet because we need to delineate our channel our Catchment based on an outlet. So I'm going to zoom to the layer And back the open street map layer You see the the blending is on because I don't have the the hill shade now underneath That's also not so important. I'm also going to remove the dm So Because of the urbanization and the modification of the area our outlet is not where the roar exactly enters the most river And we made a model the dm has been modified to to make this model where the stream is So I need to move the outlet to the delineated stream. Otherwise, it doesn't delineate the catchment um I'm going to use this tool which is called upslope That's basically the tool that delineates the catchment and it needs to accent the y coordinates and In the first webinar, you've seen that we use the coordinate capture tool. So in this case, you also use that We get this coordinate capture panel and I can choose start capture And then I'm going to choose a nice point here on the delineated river It needs to be really in a 30 meter pixel. Another way is to digitize a point and snap it to the line But here this is also a sufficient As long as you're zoomed in well I'm going to copy uh, remember the first coordinate set is in a Geographic coordinate system and the second one is in the projection of your project on the fly reprojection Copy this And the second coordinate here we are And make sure the field dm is selected I'm going to use the d8 method which looks in the three by three window to the steepest slope Downward and we'll assign that as the flow direction These ones are more complicated algorithms that take into account more directions And they work better if you have diverging slopes But here we use the simplest solution as a first try and you can experiment with the others for your study areas Then i'm going to save the file as a Run it and then it should delineate all the upstream area pixels But in raster format And then the next steps what we are going to do is to make it into a Effector layer. So we have a boundary polygon There's a little surprise for you also after this webinar I'm going to open up a nice video on automating this procedure using the graphical modeler so keep an eye on on that you can partially automate this and It's here. So i'm going to it looks a bit strange, but i'm going to zoom to the layer and then you see that It has been delineated If I sample the values inside the catchment this gets filled at value hundred and outside gets value zero It's good to remember And but this is not very useful also not to present or to make nice maps. So i'm going to convert this to polygons And here under raster conversion We can choose polygonize Use the catch raster indeed The dm that will be the name of the field in the output polygon vector file I'm going to save it I'll stick to the to the shape file just in this case. I'm going to call this catch And this d8 connectedness means that it should also look for pixels that are connected in the in the diagonal to To fit the lines of the of the vector If you uncheck that then it's the four Rule where it's only horizontally and vertically connected. So you can also play with that there we go and Here we see see the boundary polygon and i'm going to inspect the I'll get to those questions later that come in otherwise we don't get through But it's easy to get back to those questions in the end What you see here and that's important is that there are several features which value hundred So if you select them, you can see which they are and many don't show up, but they are there I'll show you why that happens And this is your catchment And this happens if I click here on zoom to selection also a nice tool And we see that there's one pixel here in a little loop And that's a geometrical problem caused by polygonizing a raster. This is an artifact of polygonizing rasters So in our attribute table We need to get rid of those those read don't really change our boundary. So what i'm going to do is i'm going to Select only the one that is our catchment I'm going to zoom to the full layer and go back to the attribute table And I switch to editing and there's this nice tool to invert the selection And i'm going to throw away everything that's done not the catchment. So we only preserve value hundred Then I save it And there it is so Now just a few steps to be done is to to style this and what we can do is just a simple fill with an outline simple line And I leave it to to occur to show In the in the seventh webinar the the shapers fill I think I think that's better in the sake of timels and to answer your question and also this This one is not really about styling So simple line and then make it a red boundary make it a bit thicker So here we have our catchment boundary the rivers With the strata orders and we can have our dm Blended with the hill shade And uh, yeah, that's a that's a nice map and we can still clip the streams There's also something I want to show because that can cause an error Which you can also fix and that's also important to know so factor clip And I'm going to clip the existing big channels to a smaller one fitting to the Catchment polygon always make sure you're in the same projection if you clip the things and save them And I'm going to call this uh channels Run it Didn't give an error that's good and um We have those other channels here, so I'm going to copy the style and paste it then to to this one And I'm going to remove this and then we have the channels just inside and we can also clip the raster There might expect some errors Which we are going to fix so Extraction a clip raster by a mask layer Input layer is then our filled dm or if you want to use the original that's also possible because it's for visualization You want to maybe use the real one then um The mask layer Is the catchment polygon the same projection. I'm not going to chase anything of this Change the no data value I'm not going to change anything there And then I save the clip one And this I call the um Run it And it worked so it's a bit robust in this case Sometimes you get a geometry error Unfortunately, it didn't show up But if it shows up then in the book we have a solution of calculating a buffer of zero But the very nice other way of doing it Is uh go to the processing toolbox. It's related to that issue with these these single cell uh polygons Because you can clip only with uh with a full polygon of course with a good geometry So in the toolbox, there's this nice tool called fix geometries And there you can Fix it for the catchment polygon which is causing the problem So I see many of my students fixing the channels the channels are not the problem is the polygon And then uh, then it normally works Uh, I clip this so I can also then I copy the style of the filled dm And paste it to the clipped one switch off this one And there it is um And then a little thing to show is the 3d viewer because we have a dm here So I'm going to zoom in to a certain area here Uh, I can also show you to get a bit rid of these pixels It's uh caused by uh resampling uh lack of resampling in the in the hillshade layer normally So we use nearest neighbor if we do uh resampling for calculations, but for smooth visualization It's always better to use uh bilinear cubic And we see that it smooths then a bit. Yeah, that's for the zoom in And then especially at distance. It looks nice. Now if I want to view this in the 3d viewer I go here to view new 3d map view I'm not going to go to the edge of my the performance of my laptop in this live demo which you can see it in my videos Um, just make it a little bit bigger. What's important is to set the source of the elevation. That's your dm Oh, sorry. Yeah dm and there I choose the In this case the filled dm can use the clipped one and it's even smaller. That's this one the last one that I clipped Um area is not super mountainous. So I exaggerated three times We can play with these things to get a better quality. I'm just gonna Start it and it takes everything from the 2d view in the 3d view it starts rendering and then I can turn it and Fly through it. It's still rendering as you see and Yeah, that's a very nice stuff that you can use the 3d viewer. You can get these these white things out of the way First of all, it needs to render the full thing but also to play with those variables If you have a google satellite or open street map on top of it, you can see it and even those arrows I'm not gonna challenge the system now to do that, but you've seen that in my posts today how to do that So that's what I wanted to show you. So I'm gonna switch back to to the plenary where we can Handle some questions before we continue to stop sharing this So Kurt um, yeah, so there's a good question here from a pio trek asks Can I set the maximum catchment area? I'd like to divide an urban area into many similar Or many smaller catchments for example one to two kilometers each and then cut the raster with them And I guess this is possible in the arch hydro tool in arc map Where you can kind of specify a maximum size for a catchment area And and I was thinking you could do this by adjusting this trailer threshold, but I don't know if you have a yeah, that's one way Uh, but an easier way or more comparable to arch hydro is to use the other approach with grass And because there you play with flow accumulation to determine these things. So you simply, uh, choose another level of strong Flow accumulation. It's also the example in my theoretical Video that if you change that value then you can tune Decisive the catchment because when less flow accumulates, it's a smaller catchment So these thresholds you can play with certainly possible other questions that came in for the plenary there was a little discussion about the fixed geometry errors and one thing I wanted to explain because it may be easier to explain than type in the chat box is that Toolbox has this mode called edit in place now There's a little kind of folder Looking button in toolbox with a little pencil icon on it if you press that it filters the tools in toolbox To those tools that can be run in place on a layer and one of those is fixed geometries So it's really nice because if you have a layer that you have geometry errors and you can Just put the toolbox into edit in place mode run fixed geometries on it And it will just fix the errors without having to create a new copy of the layer just fixes them in place That's a great suggestion for things you don't want to keep like Like also this virtual layer that I used in the beginning Scratch layers also very useful just to try out things or only use it as a temporary input um, here's another data source question is srtm 30 by 30 The best high resolution dem data that's free online or is there a higher resolution available? Well free and online are the boundary conditions srtm has been for a long time the best there are some newer ones but with a lot of restrictions only for educational use like the the isa one or dlr one very you have to fill in forms and Yeah, that's not really what we call open data, but if you do some effort you can get it Um, there's also nasa has been combining different data sources. I've seen posts of that It's still my plan to make a bit of a summary or have an intern figuring these things out But there are some more data sources out that combine the aster gdem in parts where srtm is Is performing less Yeah, so keep an eye on it things will improve but generally for these kind of Applications where we are need a dtm for general flow in a catchment This is really a good dm and many students they write in their reports like the dm is outdated Well outdated dms that takes geological time On this skill that we look at it's not about humans Changing some part of a pixel where we can't see that in these dms The mine of course is an exception and that's also something we are going to look at in the next chapter that moves That mine is moving Through time we're going to compare satellite images and other sources to see that But generally the 30 meters dm was like Luxury 10 years ago where we had 90 meter or the The gtopo one of one kilometer and that was also even sufficient for these kind of exercises. So I know for engineers, that's always A difficult thing you want to have the the max on resolution And but resolution is also not the same accuracy statistician I always teach you by students will say larger pixels are better because the errors average out so never confuse accuracy with Spatial resolution it's not it's a different Dimension right now. There's a question. I'm trying to answer about the different methods available in QGIS for filling sinks And so I was just mentioning that there's several different saga algorithms out there for filling sinks Today Han showed the Wang and Lu tool There's also a grass tool What's it our our fill dirt our filled dirt And yeah, the difference is they will work a bit differently But the nice thing about open source is that you get different tools. So I always say use them And compare and see what gives the best results Wang and us well documented the scientific paper and It's very efficient If you have a very large data set then you see already with a lot of things on my laptop It takes a lot of time for this catchment But there's the Wang and you xxl that's recommended if you have many many tiles of srtm for example So yeah, you just have to try them and figure out from From literature how they work and see which one works best for your conditions if areas are very flat You also need to work with the parameters in in the algorithm like the the minimum slope in the in the Wang and Lu algorithm Hey Hans, do you know the difference between the three different saga fill sink Algs? No No, I always recommend to start with the With the Wang and Lu one because that's considered as the most efficient and well documented best one The issue with the with the saga tools is sometimes very hard to to figure out how they work. You have to really reverse engineer a lot of things Unless you can read the code, which is sometimes also not super clear on on the on the specifics I often get that question for cringing. There's some some person stalking on my youtube channel and making remarks about it until like, okay, and I'm really challenged i'm going to figure it out, but Yeah, it's too hard and you don't know what every parameter means So you have to try and try it yourself and figure figure out it like I do that's that's important try it Yeah, there's a question here too about how many times you should use fill sinks And it seems to me that you should only have to do that once but um only once If you want more advanced fill sink algorithm, then definitely you have to look at pc raster Works in python and there you can put all kinds of thresholds how much volume of water need to be added the overflow The area etc and it's just like four or five parameters And especially at this rural area that's interesting because do you want such a mind to be filled up? If you still want to monitor what happens with the hydrography um, I have a video on that of course that you can watch but that's Something that I really wish that those tools are integrated in and QGIS also from the pc raster python library So you can use those and they're very well documented Yeah, so that's another thing. Um, there's this webinar, but haunts does have a whole youtube channel with a playlist for hydrological models and So he has he has a youtube video on We're running through the workflow. He just did with grass tools. He has You know one that goes through just the way the book does it with saga tools like he just showed And he has one on the theory behind all of this So there's a lot up there that you can use to take a deeper dive And the whole procedure in in python with pc raster so Yeah, more explanation of all these tools I would put I always put cards in these youtube videos of the webinar So you can simply click to it To to find those videos that we mentioned here Any more questions from the audience or do we continue? Oh, is it possible to export the coordinates of the streams and x y z text format? Oh, yeah, absolutely. There are there are tools For exporting, you know pulling the vertices out of lines You could also first Use the point sampling tool to get the elevation of vertices from those so you'd have x y and z Coordinates for them. So it it's certainly possible to do that. Yeah, not a nice tool for hydrological modeling or analysis the Q chain edge tool where Many of people many people ask me is it possible to sample on the on the river every 100 meters or something So Q chain is to can do that And then you have the vertex on every 100 meter and then you can use that in the in the point sampling tool To get the elevation and you can make a nice Profile along the river For example, do you have also nice tools to use? Yeah, this can be where some of the Expression engine and Q just can be really handy because you can It was a dollar x dollar y functions for for populating attribute columns with the x and y coordinates For example, and there's also a point sampling function I forget what it's called off the top of my head, but there's a a function in there that allows you to Basically calculate an attribute column and a point layer by sample getting the sample, you know sampling You know the value for a raster layer So there's some nice functions in there you can use to do some of that kind of work as well Lots of options anymore We can also discuss over the geobierce a bit later. So we go Last slice That's all I see on here Okay, let's continue with a few slides and then you guys must be super thirsty either at breakfast lunch or Dinner or beer beer o'clock like I am So I'm going to switch to back to the presentation So what we always do at the end of the webinars is Give you some information where you can find additional materials if you already mentioned So I don't go this time too much in detail. You you can find it on the website the webinar And I also has as a tap on the open open course our website The locate press link guides you to that so Keep an eye on that. There will be also the videos posted And you'll find more free course materials over there. So gis open courseware.org is the main link to get there And I have a youtube channel as Kurt already mentioned with nice playlists also a lot of theory, but also practice You can also register for a short course on QGIS at IHC Delft Institute for Water Education Kurt has been Invited as a guest lecturer in the past few years and has been great fun We do map atons and have a good time together with gis and really nice full full-time course We also get the certificate And we also offer online courses and we are working on one on this Book complete online course with all the chapters and with questions quizzes and exams in it So also keep an eye on those developments I give the word to Kurt Oh, yeah, um, so just a couple of shameless plug slides here I just wanted to quickly mention this community health maps resource I'll be posting more and more content to this. It's been a successful program that basically shows public health workers how to implement open source gis workflows so very Approachable material and there's already a series of lab exercises up there. I'm also going to be working on getting A two-day course I've developed on vector-borne disease surveillance with QGIS posted up there so people can go through that And um This came out a couple weeks ago, but um I'm a podcast addict myself. I love podcasts. And so if you like podcasts first off this is a really like one of my favorite geospatial podcasts. It's called the mapscaping podcast and The creator Daniel O'Donoghue Interviewed me about QGIS and the QGIS project a couple weeks ago So if you want to give this a listen, it's episode 50 and the link is at the bottom of the slide down there So, um, yeah, hope you enjoy that if you give it a listen Yeah, that was a great podcast nice like them too Okay, uh next week we are going to talk about open data is also one of my favorite topics and uh Yeah, now we have delineated this catchment How are we going to populate the right useful data for our studies and to understand the catchment and the dynamics better? Uh, next week also Kurt will talk a bit about the community because open data also relates to community But QGIS also relates to community and uh, it's a very nice community So, uh, yeah, Kurt do you want to say or raise something about it? I think the community is one of the things that I um keeps me coming back to QGIS more and more is just uh It there's uh it's a really welcoming place And I think one of the important things about an open source project like QGIS is that If there's something you don't like if you find a mistake in the documentation, for example You can change that and um, so all of this is um Something you have you you can kind of take the initiative on and contribute to and work on so I kind of encourage everyone to um Get more involved in the project as you can Even if that's you know, you can have your own local QGIS user group You can you know Take a deeper dive and start contributing to the documentation or to the the code for the project writing plugins All of that. There's a lot of different ways you can do that and I'll I'll talk about some of that next week Okay, great Um Yeah, so then that brings us to uh to the most important point of the webinar I'm joking the GeoBeers So, uh, you're allowed to unmute yourselves or switch on your screen and I want to thank you for for joining And uh, let's let's get on with the with the discussion over over some beer or coffee breakfast lunch, whatever where On the globe you are at the moment in which time zone so As tradition I'm going to open my my beer here