Extracting values from Raster data in QGIS - Point Sampling Tool # Lesson 23 of 29 # QGIS Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

This is exactly what I needed thanks!

👍︎︎ 2 👤︎︎ u/eclect-us 📅︎︎ Nov 19 2020 🗫︎ replies
Captions
[Music] [Music] hi guys hope you had a wonderful and eventful gis day welcome to today's qgis tutorial lesson 23. in this video we will learn how to extract values from rasa data in qgis if you haven't subscribed to my channel please do so so that you can get a notification when i upload my next video if you're new to my channel you can follow all my previously videos and useful gis tips from the links in the descriptions below let's get started so today we are going to be learning how to extract values from rasta in kgs and this can be any raster or a polygon layer that you want to extract some values so the first thing you're going to do is you'll include our rest and then we're going to create a boundary and that's a polygon and our around within our raster layer then we're going to generate random or regular points within the polygon then finally we're going to extract these raster values from the point data so let's go to qgis and start this exercise i'm going to open a qgis and open a blank project then i'm going to load the raster layer that i downloaded for this exercise so i'm going to go to layer add layer add raster layer and then i'm going to browse for where my raster layer is and it's a in the desktop gis data and i put it in the point sampling tool data and open i'm going to add the raster layer and click on close and you can see this is a raster layer so the next thing i'm going to do is i'm going to ascertain which region it is and it is in ethiopia how do you ascertain where where the data is from i'm going to load a base map and i'm going to add a maybe a google map image and it's in a region in ethiopia so we have also trained that our data is perfectly placed in the our region of interest so the next thing i'm going to do is i am going to create a boundary for our area of interest to create a boundary we need to create new polygon layer so i'm going to go to layer create layer i'm going to create a new shapefile layer the file name is going to be i'm going to save the file name in the same same folder chairs folder data and i'm going to save it in the point sampling tool there there then i'm going to call this there boundary and right click on save then the geometry type is a polygon then the projection i can match to our our project projection which is uh the projector projection which is the 37 north utm37 no then i'm just going to put one column there called maybe same say the name or maybe it's a test text data then i'm going to add it to fail then i'm going to say okay that is enough so i have my new boundary layer here so i'm going to digitize a new boundary first of all i'm going to just uh make the boundary hollow so i'm going to go to symbology then i'm going to make it a simple line and i'm also going to change the color to red color and just increase its size a bit and we are good to go i'm going to click on apply okay i have and now i have my my boundary ready for digitizing so it's just an empty boundary so we need to add some information here so i'm going to start editing by clicking on right click on it and then going to toggle edit and you can see now all my tools here are active so i'm just going to create a i can actually just digitize randomly but i want to create a regular rectangle so i'm just going to select a rectangle from extend and i'm going to just create a very nice extent here so this is the area that i'm interested in and i'm going to call it a that's the area so i'm interested in creating random points here so that i can go maybe to the field and maybe just do some ground truthing so the next thing i'm going to do i'm going to click on save and stop editing so i have my layer boundary here so the next thing i'm going to do is i'm going to create random points within these layer bound so i'm going to go to vector research tools then there are very many things you can actually do here you can actually create random points in an extent or you can either create a regular points in in an x center or a layer bound you can also create random points inside a polygon so for these exercises we're just going to create regular points within this polygon so i'm going to select uh regular points then um the input extent is i'm going to just select calculate this extent from the boundary you can actually calculate it from maybe say the dm output or or whatever other layer that is visible here so it's up to you to decide so i'm going to just use my my extent then the point spacing count is going to be maybe say because it's in meters i'm going to say maybe say after every two kilometers which is 2000 meters i'm going to be having a point then i need to leave everything else that as it is and i'm just going to create a temporary layer so i'm going to yeah i'm just going to click on run and it has told me the regular point has finished so i'm going to click on close and you can see now i have some regular points within my layer bond you can actually decide to maybe measure the distance between one layer to just as the same if it is two kilometers so i'm just going to click on the measure tool on the toolbar and then i'm just going to select one point and you can see it is actually two kilometers by two kilometers so let's go to the next now let's go now to the main exercise that we are supposed to do when you open the attribute table of these regular points you'll find that they just have some id number from zero going all the way to maybe the 2257 points so what we want to do is we want to add another column here that has the information about these this area of our raster layer and the raster layer is a dm is a dm data to just look at the kind of values that are within this area you can just select the select feature then you can just click on on any any area randomly and you can see it it's giving you the value which is the dm which is the elevation like for this one is 187 when i click on a different region it changes so we actually want to just extract some of these values into our point data so what we're going to do next is we're going to install a plugin that is going to help us with this exercise and so we are going to go to plugin managing instruct plugins then from all from we are going to select all and i'm going to select point sampling tool so we're going to use this point sampling tool to actually get the uh the values of the raster within the point data so i've already installed it you can install it i'm not going i'm going to install it again so i'm just going to click on close and this is how it looks like so when you look at your toolbar it will be added there on your toolbar so this is the point sampling tool now since we have our regular points and our dm here and our boundary now the next thing we want to do is we want to now get the values of each and every point here and which which is going to be the elevation values so we're going to click and select the point sampling tool then the layer containing the sampling points which are the regular points is the regular points it has already selected that then the layer with the field or band to get values from is our dem so the output is the dm you can actually even put the polygon if you want if you had a polygon that is underlying here you could have just selected also the polygon and even if you have multiple dems you just select all of them together and you can just get the values of all those polygons that are even overlaying on top of each other so what i'm going to do i'm just going to select the dm for now then i'm going to browse on how i'm going to save the file and this is in gis data point point something too and i'm going to change it to a shape file you can even put you can even put a csv if you want or anything else but i'm going to just save them as ship files then i'm going to call them regular points with elevation because i know i'm going to have a new column of elevation values click on save the share file then i'm just going to click on run and okay and you can see it's processing here all my points and it has finished processing okay the new layer has been added so i'm going to click on close then i'm going to now look at now my new layer here and you can see it has the dm values now add at each and every regular point so you can do the same thing by creating random points and using the same same tool to extract the same same values so the next thing you're going to do is you're going to label these regular points so that we can just look at the kind of information that get by going to properties then levels and single levels the only attribute that you have is the dm output which is the elevation and i'm going to just create a buffer around a white buffer another text i'm going to just make it maybe blue and i'm going to click on apply okay and you can see now all the elevation values for the regular points in display and within our attribute table you can also add the x coordinates and y coordinates in this column and be able to just go and do your field surveyor ground to thing depending on the need of your fieldwork that's it if you found this video useful and you want to learn more qgis subscribe to my channel hit the bell icon so that you can be notified when i upload my next video otherwise i'm just happy you're here see you in my next video you
Info
Channel: WiseGIS
Views: 2,924
Rating: undefined out of 5
Keywords: QGIS, qgis 3.14 tutorial, qgis tutorial making a map, qgis3, point sampling tool, point sampling tool qgis, gis, gis tutorial for beginners, qgis 3.10 tutorial, qgis 3.16 hannover
Id: HnfadKB415A
Channel Id: undefined
Length: 12min 53sec (773 seconds)
Published: Wed Nov 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.