Quick Flood Analysis with QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello welcome back on my YouTube channel in this video we're going to do a simple flood analysis I'll start with adding open street map from the browser panel to have some context and I use the locator bar to locate a city in this example I use reram zoom in to the area that you want to study now I'm going to install a quick osm plugin which I will use to download buildings from open street map click this icon and in the quick osm dialogue type for key building leave values as it is so it will search for all buildings in the canvas extent expand the Advan section and make sure you only have multi polygon selected Ed in the right column so we will only download building footprint polygons click run query after it downloaded all the buildings close the dialogue and check the result in the lower right of the screen I see that the underly reprojection is the pseudo merkator well I want to work in the Dutch projection so here I've changed the projection of the project the on thefly reprojection to the one of the Netherlands next I want to export the buildings to a GE package using the correct projection so select a GE package give it a layer name and I changed the CRS to the one for the Netherlands so the buildings will be reprojected from pseudo Mercator to this projection click okay let's remove the temporary buildings layer because we are going to continue with our DU package building layer the next step is to download the digital terrain model and the digital surface model of this study area for this I will use the P do Services plugin with the p do Services plugin you can get access to many open data sets for the Netherlands after installation click the pedoc services plugin icon and there you see the list of layers that are available Ahn is the Dutch elevation model and here you need the WCS layers for the digital surface model and the digital terrain model click one of the layers and click standard to add it to the layers panel this will take a bit because it's a large data set now repeat this for the digital terrain model if you choose bothen it will arrive at the top and if you click under at the bottom of your layers panel here I choose Boven because I want it at the top this a 50 CM elevation model uh available in the Ruster format so we can further process it let's clip the DTM and the DSM and I'll use export and I save it to this file name GTM Rotterdam and then make sure that I use the map canvas extent so I clip the whole DTM to the map canvas extent and then I click okay it will download all the pixels now remove the original layer and repeat the procedure for the DSM click right use export save as use the file name take the extent from the map cans extent and click okay let's have a look at the layers open the layer styling panel and remove the DSM and what's always nice to visualize is using the hill shade so I'll hide the layers that are below and here you see that with the DTM the building Footprints have been filtered out of the elevation model so there we have the terrain and with the DSM we can do the same we visualize it with the hill shade and there we see also the difference that it's the DSM the buildings are present also all the natural features like trees but we need to interpolate our DTM if we want all the surface levels that are also below the buildings so I use the fill no data tool from gll with that tool you can interpolate no data values which are called voids so use the DTM as an input and change the maximum distance to 100 in this case so we have a search distance that is uh enough to contain other pixels to base the interpolation on so this distance is in pixels and our pixel size is 0.5 M we don't need any advanced parameters and we save the result to DTM void removed. Tiff then click run close the dialogue go to the layer styling panel and visualize the result as a hillshade and compare it then with the original one and here we see that most of the voids have been filled let's remove the original layer and now we compare the DTM with the voice field with the DSM so here we see in the DTM that the buildings have been removed and the trees too now we can also have a look at the histogram if you click compute histogram you will see here the distribution of elevations in this uh image and you notice that there are several Peaks these Peaks have to do with the presence of dyes and Boulder levels that are at different uh Heights now I'm going to calculate the slope to have an indication of the dkes because the Dy should have steep slopes I keep all the defaults here and I say the file to slope here we see the resulting gray scale looks a bit sketchy go to the layer styling panel and there I use single bam pseudo color because it's a continuous roster and I choose here the veritis color ramp and uh this doesn't give as much contrast and a good way to increase the contrast here is to use a cumulative count and there you see now in bright yellow the steepest uh features which are our dkes so this is a way to uh get more information about the structure of uh this polar area with the dkes we also see the talut of uh highways and other infrastructure next I want to extrude the buildings let's have a look at the layer properties and check the attributes you can find the attributes under the information Tab and if you SC scroll down you see here all the fields that are available in the attribute table there are two fields that can be used to extract the elevation that's the height field and the building level field however these fields are often not filled in and give an unreliable result so in this video we're going to do it differently we're going to use the DSM Heights for giving the heights to the buildings go to the processing tool boox and search for zonal statistics double click the zone of Statistics tool and make sure your input layer is the building layer and the Ruster layer from which we want to uh calculate the statistics is the DSM use the output column prefix of zcore and we are interested in the mean elevation per building footprint taken from the M uh and we will use that then as the elevation of the buildings save the result to the J package and call it buildings with height click run click close after completion I'm adding DTM void removed under buildings with hide and I hide other layers I'm going to style the DTM now with single bam pseudo color and I'm going to save the project save it as floods and I'm going to style the buildings with height and choose the 3D View change it to single symbol and for Extrusion I used a data defined override and I used the z mean field that we've just used for zon of statistics and this will lift our buildings to the average elevation that was found in the DSM so now I'm ready to use the 3D map view and here you see the extruded building buildings in the landscape in the layer styling panel you can also control the color of the buildings now I still need to configure that the DM Ruster that is below uses the DTM elevation values and I'm increasing here the tile resolution to get some better detail click okay and now we can see the dkes in the landscape and the buildings and this gives us an impression of the elevation differ refences and the objects at the surface the next step is to calculate the flood map double click on the DTM and use the less than or equal operator and type one so we'll select all the elevation values that are less than 1 meter and we will give that the value one for true and the other pixels the value zero for false in this way we simulate a sea level rise of 1 M this the result let's style it to make more sense out of this and we use the palleted unique values renderer because it's a Boolean Ruster remove the zeros and change the ones into blue so it corresponds with water now we see which areas in the city are flooded we can also see which buildings have been damaged now I'm going to create a polygon from this flood Ruster and save the file to a shape file and here's the result but it contains both the zeros and the ones go to the attribute table I use select by expression and I choose DN equals z to select all the features that have zero so which are not flooded then I toggle the editing mode and I delete those features so I only have the flooded areas left over to go off the editing and save the edits and also give this polygon a light blue color for water you can here also reduce the opacity so we can see what is below of course we need to hide our flood Ruster and it's also nice to add aerial photograph below and we use here the 8 cm aerial photograph and put it below I hide some layers that were in between and there I see the flat extend over the aial photograph now I would like to visualize to flood with 3D buildings in a 3D view instead of using the default 3D view of qgis I'm going to use the qgis to 3js plugin hide all your layers and make sure only the open street map layer is visible in the map canvas then click the icon to start the qgis to 3js exporter click the DTM voice removed link here and you will see here that the open streak map is visualized in a 3D view you can use your mouse to navigate in the 3D view now go to scene and choose scene settings and there we can change a little bit the exageration to see better the elevation differences so here I change it to three and click okay the the 3D view will render and here we see the result and now we see the dkes visible in the landscape the next step is to go to the layer properties of the DTM and increase the resolution by increasing the resampling level and change the image width to 4,096 which is the highest you can choose then click okay if your computer can not handle this you need to lower these uh resolutions here we see the result and we see much more detail here in the city and we can clearly distinguish the dikes here in the landscape now go to the layer properties of buildings with height and set the type from polygon to extruded for Z coordinate use relative to DTM for the geometry use does that mean for the height keep the rest as default and click okay now check the box to show the buildings now we have the buildings in 3D draped over our open street map which follows the digital terrain model now go to the layer properties of the flood polygon here also set the type to extrude it for the Z coordinate used the DN value which is one in this case which was true so one one meter and for geometry I also use the one from the DN if you use other elevations for the flood you of course need to edit the DN field with uh the flood height that you are using and here's the result we see in a light blue with some opacity the flooded areas uh let's maximize the screen and fly a bit through the landscape to see which areas are flooded of course the areas which have uh dkes or higher areas in general uh are not flooded but all the lower areas now are blue so I hope you've enjoyed this video and uh that this helps you to analyze floods in your own uh study area
Info
Channel: Hans van der Kwast
Views: 5,389
Rating: undefined out of 5
Keywords: DSM, DTM, QGIS, Qgis2threejs, buildings, extrude, flood, inundation, urban
Id: PL5ScexN78Q
Channel Id: undefined
Length: 16min 46sec (1006 seconds)
Published: Tue Feb 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.