Assign elevations from a DEM automatically in Qgis ( Drape points)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is the mining geologist and i'm back again with another very exciting and very informative tutorial so uh again we're looking at qjs my favorite gis tool and even that it is actually a gis tool uh i use it in other stuff related to the mining industry and geology so don't think that as a mining geologist or as a mining engineer you should only learn mining softwares no there's this software that can actually do uh almost pretty much anything and i use it to solve a lot of things and sometimes even if there's a tool that i need i even considered you know developing that tool using uh python scripting by the way if you guys are really interested in python applied to geoscience to mining engineering uh please let me know in the comments below because i'm actually working on a master class believe it or not that will allow you to create your own geological modeling software totally in python so this is going to be something crazy that doesn't exist anywhere else and i'm going to be the first one that will create something or a course about that let me know if you guys are interested about this topic and i'll try to make uh some youtube videos about uh this so in today's tutorial we are going to to solve a problem it's a really you know small problem but it's uh something that you can be doing this on a daily basis or something that you will need a lot as a geologist or as a manic engineer so imagine with me i don't know if you guys have taken a look at my previous tutorial how to generate points with a regular spacing in an area go and check that out because uh that this one could be like a second part for that tutorial so also stick to the end because i have something like some sort of a surprise for you guys to see so stick to the end of the video and i'm gonna show you what it is so uh imagine that we have a bunch of drill holes in here and somehow or we lost the elevation data but we have the topography and some people actually tend to go there point by point and let's say if this is a dem and i click in here for example i got the elevation it's about 1070 there it's a thousand and uh 57 there it's a 302 here so imagine that i have a lot of points in here and i need to assign an elevation to them or let's go and do the same exercise that we've done in the past in the previous video for people who who are lazy to go and check that tutorial so let's but if you want you want to see the details go and watch the previous video so let's go and create a temporary uh scratch layer and uh call this like probably area and uh keep it that way let me go and really fast so this is not actually the tutorial guys this is just me making some data and if you're interested to see what i'm doing here go and check the previous tutorial so let's make this simple and say like probably 50 and i'm gonna use that layer and let's go and run yeah i have one point because it looks like the area is really but okay let's not do that let me go and remove this discard okay and i'm gonna go and toggle editing here and let me go and assign some other points so this id uh one okay another one two another one three or whatever okay so let's just make another point so these are points so i have the x and y for these but i want to add the elevation so i want to grab that information from the uh this dem without actually going through this and click on that location i mean like selecting this and click on that specific location and i know it's 520 so in our case they're just basically five points and that's not too much what if we have like a thousand points and it is actually nearly impossible to do that in a short time so this is going to be time consuming and there's actually a way to do that in the previous tutorial i've showed you how to actually calculate the x and y automatically for these points so we don't care about this id so let me go and delete that so in order to calculate the x and y for these coordinates for these points what all i have to do is to go to the field calculator by the way this is the attribute table you right-click and go to the attribute table this is where all the information about these points are stored okay this is like an excel cheat inside uh that layer okay that stores whatever data that you want but there are actually some data that some spatial data like the area uh the x the y and the elevation we can calculate that automatically and you can make like a combination of all of these to like get uh the information that you want okay maybe that for example you want the area divided by four so the the same things that you can do in excel you can do this here or almost er same things okay so let's go to the field calculator and this is actually the calculator that will allow us to create some sort of scripts and be able to generate an expression and apply that to all of the features that we have in that layer in our case let me show you a simple thing so let's create a field which means a column in which we are going to calculate the x automatically okay so the x we are going to choose like a decimal number because we want some precision we'll call this column x and the expression for that is actually the dollar mark and x and you can see in the preview here that this is an example of an x so we know that this expression is right if you want to go through this you can go to for example to geometry since x is related to geometry and you can see that that specific thing that specific expression is actually here you can see the dollar mark and x this will allow us to calculate the x now if i click on this one you will have uh an example here so if i use the dollar and x i will get 42. i'll get exactly a number in our case we get the x value if you can go to all of these and see how they work in our example here for x at you add this one and you have an explanation in here and you can see what it generates so this is going to be x and you can see that we have the x coordinates let's go and create the uh y this is just to show you what or how we can do this so again the dollar mark and y and you can see this is actually the y and we have the y coordinates now what about the z we can't actually calculate the elevation automatically we need to grab that data from the uh another layer which is in our case the dem so let me show you the expression to do that so we know that the x the dollar x give us the x coordinate and the dollar y gives us the y coordinate let's go and check some of the expression that we have in here we're going to call this z for the elevation and you want that to be a decimal number with just two decimals for the precision in there and let's go and search so basically we have a raster we have a raster which is a dem in which we have the elevation stored in the pixels okay so that information of the elevation we need to extract that from the pixel so we need to have access to the pixel information uh on that specific uh x and y coordinates so there's actually uh an expression here called raster value that will allow us to extract the value of a raster in a specific point so boom that's exactly what we want so here's the expression it's raster dash value and then we assign the dem which is in our case that dem and then one which is the band so if we have just you know a grayscale uh dm that in which we have just black and white then basically we have just one band i'll show you in a moment how you check how many bands uh you have in a restaurant uh file and so basically in our case and in your case also if you have a dm it's gonna be one here so it's gonna be always one and then make point so that's another uh expression there make point that takes x and y so here in this one and one we can replace these with the expressions that we've seen in the past which is the dollar x for for the x coordinate and the dollar y for the y-coordinate and this is going to give us the raster value in that specific x and y-coordinates and that's which in our case it's going to be the elevation so i hope that clear guys and let me see how this actually works so we are going to double click on this one we have the raster value the second thing is the dem so here is how to grab the dem so basically the dem in our case is the layer that we have in uh the project right here so you can see here you will notice that we have map layers okay with this one we can have access to any of the layers that we have and you can see that this is the shape file that we're working on and this is the dem so i just uh double click on this one and you can see that the dem is now assigned so if you forgot about the expression you can go back and type in raster and click on this one you can see now that we have raster value now dem that's our dem and then we need to add comma so we've added the comma and then we have space one which is the band number one and you can see that now we are in the band we have the layer covered we have the band covered now uh another comma now we need to insert the point so all we have to do is to uh type in make point which is another expression and now we need to have the x coordinate how do we calculate that automatically in this specific point so all we have to do is to use that expression dollar x and then we add the y coordinate dollar y and now all we have to do is to you can see that expression is not valid let's close these and let's close that again and you can see now we're grabbing the elevation now if i'm going to click on okay you can see now we have another column which is the z which is the elevation and we've grabbed that elevation from every single one of these points so automatically without any hustle and now if we uh let's go and close this one and stop editing now if i click on this one you can see that i wait a second you can see that i have the elevation and x and y so if i click on this one or what's happening here oh uh i'm clicking yey outside i guess so did i save it oh i didn't save that so they were not saved and uh that's uh that's not an issue so all you have to do is to uh do that again and you get the x and y and z sorry for that but that's it so then you basically when you start editing and you and click this one so let's say i'm going to type in a lot of things here and then you need to click save and it should be saved okay so let's uh look at this again it's saved anyway so this was the tutorial how to actually calculate that automatically the elevation based on a dm but we for before we end this uh tutorial i said for the people who are going to stick to the end actually uh make sure to subscribe that's the first thing please that's what we share here qjs 3d geological modeling and mining softwares this channel is for you and the second thing this is actually the website where you can learn a lot of things about mining engineering and i have a lot of courses in here you can see that they're pretty cheap but if that's not uh cheap for you then i've got this uh thing for you which is the um which is actually a coupon code use mining subscriber before this date here and you will get 50 off so if you use that today you'll grab any of these courses for 15 bucks and that's something that you cannot find anywhere on the whole internet so use the coupon code mining subscriber and grab any course that you want before this date so i hope this tutorial was useful for you and please if you have anything in your mind you want wanted to be covered in a tutorial let me know in the comments below and i'll make sure to add that as soon as possible so that's it for this video stay safe and see you in the next one
Info
Channel: Mining Geologist
Views: 673
Rating: undefined out of 5
Keywords: qgis, qgis tutorial, gis, qgis 3, introduction to qgis, qgis beginner tutorial, qgis for absolute beginners, qgis add data, qgis tutorials for beginners, qgis 3.10 tutorial, qgis 3.14 tutorial, basics qgis, tutorial qgis, geological database, qgis geology, drillhole planning, qgis mining, qgis mining engineering, drape points, drape points qgis, elevation from DEM, elevation from raster, extract elevation qgis, qgis calculate elevation
Id: lDRdevZhM3o
Channel Id: undefined
Length: 14min 53sec (893 seconds)
Published: Thu Sep 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.