Stream and catchment delineation in QGIS 3

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this exercise we are going to delineate catchment and strings solely based on open data we'll first start with finding location of our catchment we are going to delineate the Ruhr catchment and we use the quick map services plugin after installing the quick map services plug-in you can find it under the web menu if you go to settings and go to the more services step you can get the contributed back which allows you to use any more services and have a long list like I have here from there we choose OSM always I'm standard which gives us a world map street map then we zoom into our area of interest so we're looking for Devore River and the outlet is somewhere in the Netherlands in a place called Vermont we can bend to it it's where the wor river flows into the Moe's that's where we are going to define later our outlet of the catchment so Vermont as a city it's been some human interference with hydrology so we can see here we see different rivers that are outlet in the most river and then we zoom out to have on the screen and the whole catchment so the river war originated somewhere in the Eifel area in Germany it's over there and then it flows northwards to the border with the Netherlands to come up in Vermont so here we are changing the projection of the project on the fly projection I'm checking here in which UTM zone we should use and apparently it's not sound 31 which we use for most of the Netherlands but it is zone 32 North that we need so we choose zone 32 north and then our project is automatically on the fly we project it to UTM zone 32 north the next step is to zoom in on the area that covers the whole catchment that's of course a bit of an estimate we need to make because we don't know exactly how big the catchment will be it is important that we take it not too small because then our result will be a bit squared on the sides and if we make it too big then if you take too much calculation time so well here is the source and then it goes to Vermont to the outlet so that's about it so we will use another plugin the SRTM downloaded shuttle radar topography mission downloader to download the tiles of the 30 meter resolution DM the one arcsecond DM that is freely available to this plugin you can set it to the canvas extent and then it will take the area that is in our map canvas and then you choose a folder where we want to store the tiles it comes in tiles let's create a folder or or and then we click download and also we've checked and load images to QGIS there you have to give your credentials for this data repository if not you can see the links to create your user account after logging in the data will be fetched from the internet and loaded into QGIS automatically when it says download complete you can continue so we see here is different tiles we switch them on and off we can see what area they cover and we can already see that we have bit too many for our catchment so the next step is to mosaic it means to merge the raster tiles that we need for our catchment delineation removing here the ones that I think are not necessary I only have the three tiles covering the catchment then I go to roster miscellaneous build field role roster you're going to make a virtual mosaic because that's not the end product so we can keep it virtual to save a bit of data in calculation time and here we can choose for the resolution average highest or lowest but they're all the tiles have the same resolution so it doesn't really matter what you feel in there then we have to uncheck the box place each input file into a separate band that is needed for remote sensing images where each layer is merged into a stack of layers that can be used in remote sensing analysis for example the resampling algorithm will be nearest neighbors or uses the purest values of your pixels now we give it a name for the virtual raster that will come out of this merge algorithm we call it diem mosaic mosaic is a technical term for merging of rosters you see the GDL command is executed and there it is so we can remove the tiles that we don't need so we only see our virtual Ruster and then you can rename it that's always good practice because spiritual doesn't say much so we call it DM mosaic they will be then the name of the layer and in the different tools we can always find back and then this label of the name of the layer the next step is to reproject this mosaic because it is now still in epsg 4 3 2 6 which means geographic projection which is latitude longitude so we go to rest our and protections and we choose warp make sure you have your input layer there and we choose then the projection of the project which is UTM zone 32 North for the no data value of the output bands we can put a value minus 9 and 99 for example and the resolution of 30 meters so we are sure we will get an outer ester with 30 meter pixels and as we sampling we choose nearest neighbour which is important because we are going to do calculations quantitative analysis well if you just want to smooth map to come out like if you do referencing a scan map you will use another resembling method so the GDL warp command is applied in this case you can see how it's executed and then we choose an output layer name and this time we don't want it to be virtual so we call DM we project it and then we choose TIFF to make it a geo TIFF and then we save it and we run the algorithm when it's done you can see the result on the screen of course it's because of the on-the-fly reprojection overlapping with the other one so we can now remove the future mosaic and we have had their octave we rename it and call the project the next step is to make a subset out of this to cover only our area of interest so we make sure we only see OpenStreetMap we go to roster extraction clip roster by extent and there we choose the DM reprojected and if we click the three dots on the clipping extent you can say they're select extent on canvas for that purpose it's very important that your on-the-fly reprojection is matching with your layer that you want to clip in our case the DM reprojected and we can draw a box to make sure the box is big enough to fit your catchment but not too big because then the calculation times will be too long and your computer might be running out of air out of memory so we save it let's call it DM subset so subset is the technical term clipping is a tool now we run the algorithm and there we have our clips map there it is now we can rename the layer because clip doesn't say much let's call it the subset and what we're going to do now is to fill the things so all these DMS have a problem that they have things and spikes and there's an iterative procedure to an algorithm to fill it and we use the Wang and Lu method from saga so we fill in the dialogue we can only choose in this version of qss dot files as output that doesn't matter is also a jido supported raster format like the geo TIFF so we can here we only need to fill the DM so you can check the other boxes that will come later you do have another dialogues so this generates a hydrologically corrected DM removing all the things where water can get stuck now this is the most calculation intensive algorithm that we use in this procedure therefore it was important that we had a subset and not the full data set it uses the saga algorithms and it's nice thing about QGIS that it integrates algorithms from third-party providers and when it's done we'll see that filthy appearing in our layers list you can remove our previous steps we don't need that anymore and we continue with the filled VM let's style it a bit so go to symbology single vamps widowed color and from there we first have to look at the minimum maximum value you can choose the whole roster and you can say we want the actual values and then we use color ramp when we click on it we can make our own color ramp but you can also use the drop-down menu to choose a tool to make a new color ramp you see all color ramps and we can say create a new color ramp and if we choose their catalog CPT City we can choose from some predefined color ramps and receive QGIS or topography we choose elevation since it is VM and then it automatically generates scale which you can adapt of course and there it is our DM visualized with different colors a nice thing to do for better visualization is if you duplicate the layer and we create a hill shade so check the box and there's a nice trick if we press f7 we get this layer styling panel on the right side of our screen and there we can choose ill shade and it will be directly applied to the map in the map canvas so all changes you make their lives we move this rotation of the Sun the azimuth we see it life changing and we know that when it isn't when the Sun artificial sunlight is in the northwest we get the best of' representation it also use a set factor there or play with the multi-directional option but for our purpose this is okay let's zoom into an area with a lot of elevation differences at upstream so this is our DM classic trick is to make it a bit transparent so we move it to seventy percent transparency make sure that it's applied to the one that you choose so in our case I had to select fill TM and then move it to let's say 70 percent so we see our hillshade below that works nicely but there's a nicer method available in QGIS where we use the blending mode if we put it on multiply it really integrates values of layers below the one that we choose to be blended so the blending mode really here adds the shaded really have to the elevation map let's also rename our hill shade so we don't get confused later it's called ill shade now a resume to the layer we see the whole layer now with this dramatic effect of the hill shade this is visualization betwe the DM we can do also other things under the Ruster menu and then analysis you can find different options for calculating slopes you can even calculate a hill shakemap but we know that was shading by the symbology you can complete the slope or the aspect but for our purpose here it is important to use this Phil TM to continue with the analysis the next step is to calculate the stroller order so in the processing toolbox we can look for stroller order make sure you have the filled diem as an input and we save it to a file or note it also here's an S dot raster file from saga we call its trailer and it will calculate strata orders from one to ten where one are the smaller streams and ten are the largest streams the idea is that we use this later in another algorithm to set the threshold for what we would call a river now the Strela orders from 1 to 10 are calculated and there are this we need some visualization so let's make a good symbology there two single bank pseudo color in this case it's a an ordinal map so it can use a ramp and it's good that it goes from from white to blue where more blue means bigger River so that is it's perfect that we just make to have to be sure that we have here ten classes from one to ten you have to move it to eco interval and then we choose ten classes and we see no ten unique classes when we click OK you can see the result with in darker blue the bigger rivers and in lighter blue the smaller ones and now it is the question we have to put threshold not that's a calibration that we need so what we do is we have our OpenStreetMap layer and we have this strata order layer and we can see already the bigger ones the higher orders follow the streams but which order exactly is the cutoff you need to calibrate it so we can do that by going to raster and then the rustic calculator there we can say stralla order larger or equal then a certain threshold value so we click there and then we can choose there five or we can choose eight we can play a bit around with the value let's use eight in this case and we save it and the folder them create it before and call it straddled if we add the eight so we know that that's the cutoff value that we used here so it will give a one for all the pixels that are true so large or equal to in strata eight and zero for all the ones that are false so we get a boolean map it only true and false and we can with some styling also make it a bit more intuitive we can remove all the classes here that you don't need and select also multiple holding shift and we add here class zero so it's only zero and one and we are going to change the ones to blue because it represents whatever no I'm very bit about the zero because we are going to make that one transparent go to properties and then transparency we can add the zero and then what we see of course we have to remove the strata or the map that's below we can see now in blue all the ones the true values and see how well it follows the river we see it approximate it it's not very good in this area there are also some lakes that interfere with the natural flow if you go more up streams we get better matches in the part where the river has not been straightened so this is just gravity based flow and of course we're looking at a stroller valuate maybe you need a lower value to better represent the river let's have a look with the further upstream what happens there near the source of course some big minds in this area and look really upstream we see them much better match because it's more natural there although there are some dams and there it really follows the meanders so let's go to the outlet two hormones so here's Vermont nearest outlet and we're going to use the channels and channel network and drainage basins algorithm to delineate the streams so as an input we have to choose there to fill DM in the threshold who use the calibrated threshold for here for now I use the value of 8 and there is as different outputs we have the flow direction and it's called as flow deer and as flow connectivity we don't need that stralla order we already had so to only reproduce that drainage basin there are two times in this dialogue drainage basin one result in a raster the other one in a vector so let's use the way where it automatically converts it to a vector the same for the channels so the channels are derived from stralla but then converted to a vector layer lines and area of the basins which will be a polygon layer the junctions we don't need that so then we can run the algorithm again an algorithm from saga and there's results close the dialogue and let's see what we got here we got flow direction but we need to work on the styling we've got the channels within a strange color at the moment we see different channels in the whole area after DM and we also see the boundaries of the drainage basins got a bit square in the south so I have chosen the DM a bit too small and then that happens so you know how that looks like we should prevent it and make you clip your subset a bit larger now let's style the flow direction map which is in single man pseudo color and with a bit of customizing you can come up with a legend like this it's a directional legend so Northwest should be very close to north in terms of colors it's always a bit tricky and you should also take care of the coding of the flow direction now if you google QGIS saga flow Direction legends you will find Stack Exchange some discussion about it to find the right values now in the same way we can style the channels those are these are vector so let's make them blue so we recognize them as rivers that looks great we see from the source to the mouth and we can also style our drainage basins and this is not a single symbol but categorized each catchment has its own number so we need to choose also a column to look at it choose value which has a unique value for each Basin we click classify its unique value as a color apply it and there we see the result and the big one here is the Ruhr catchment already so now we need to find the coordinates of the outlet because we want to calculate the catchment which pixels in fact drain to that outlet let's look here where we see that the rule comes in to the mers River although it's a bit human control it's not very precise but if we take a point there on the line and a good way to find the coordinates in the projection that we have the project is to use the coordinate capture tool which comes with the QGIS and there we can say start capture and then it's very important that we really place the point very close to the line because it needs to be in one 30 meter pixel if it's outside of the river pixel then according to the model there is no River from the processing toolbox we choose the upslope area algorithm and we paste the coordinates in so make sure you have the UTM coordinates or the first field is the latitude longitude coordinates in the second one are the map coordinates for elevation be sure you choose the filled DM and we leave everything else on default you can play with it later to try other algorithms and other thresholds and we call this the Ruhr catchment it will be a raster which has fair value zero for outside of the catchment and value 100 for inside catchment again a saga algorithm here we see the result but we're very zoomed in so let's zoom to the lair and there is your catchment and what we already concluded before is that it's cut off on the south side we didn't make it big enough but for the rest it looks okay now the only thing is that we don't need it as a rest of it as a vector so we can convert it go to Ruster conversions polygon eyes and there we choose this up slope area map and it will use the digital numbers of zero and hundred to create polygons we save it and save this geo package but in this case we'll save it as a shapefile good thing about geo packages that we can put all the layers into one geo package so you can try that now I will save it only in separate files and let's call this the world catchment shapefile and that's basically it when I run this it will do this jido command and it results in a factor layer consisting of polygons we can check the attribute table there we see three entries number one is clear when you select it number two is unclear and the last one the zero is the outside so we talk our editing mode we're going to remove these zeros first because we are not interested in the outside polygon so now it's gone and yeah we want to know what this second value of 100 is this can sometimes happen and there's this function in the zoom panel you can say zoom to selection and we see that there is one pixel which is a bit strange so the polygon makes a little loop there and we're going to remove that so I go back to the attribute table and I select this second two and delete it and I save the result and now we have only the fact earlier left you still see it on the screen but not select that's because of the roster so I remove that one and now we see the vector layer I'm going to rename it let's call it the war catchment now I also want to change the style and air we choose transparent fill and for the stroke color we will choose red and need a little thicker and now we have the boundary of our catchment in red as a shapefile now it also would be nice to clip our rivers our channels to the polygon of the rural catchments so that's what we do with this clip to give it an out good name and we can save it in a Geo package or shapefile the Geo package you can put everything together but we will choose here a shapefile go through a river and then we can run the algorithm and we see if we remove the original one that now we have the clipped ones we can copy the style still from the original one copy style and then we paste it you now we see the rivers nicely clipped to catchment boundaries we can do the same for the DM choose extraction clip raster by mask layer then of course your mask layer is the polygon so we choose to fill TEM as an input and the mask layer were catchment it's also good to specify and no data value I can put there are also - nein nein nein nein then we run it and now we can copy the style from the original DM to this one but we still need to make the zeros transparent you just remove some of the other ladies we add zero and here we see the result so we're going to rename also this layer so we don't get confused we can do the same for this one we can clean up a bit or we don't need and we can even cut the hill shape so it matches the extent of our clipped DM so we don't have the the sides and remove this one and we make a duplicate of the other one we did before and then rename it to a hill shade and then we can also then use the f7 to change it into a hill shape and we have to add the missing values so go to transparency there we can add the zero apply its life applied and there we see the result this is how we delineate streams and catchments using only open data in QGIS 3
Info
Channel: Hans van der Kwast
Views: 73,528
Rating: 4.946537 out of 5
Keywords: QGIS, SRTM, OpenStreetMap
Id: Ro-RRzMMw-c
Channel Id: undefined
Length: 33min 39sec (2019 seconds)
Published: Thu Aug 16 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.