QGIS Research Tools Grids

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi brazil it's ian here um yeah so i'm going to show you what you wanted to do there with that grid and under the research tools i think it's research tools and i think you might kick yourself when you see how easy it is although there are some there are some things that that might be worth bearing in mind when it comes to the actual grid measurements so if we open up qgis actually i think i've already got it open there we go so we open up q just uh let's just start with a little study area um okay so what i'm going to do is just add the google terrain and then zoom into a familiar place yeah this area looks fairly familiar great okay so you started off by creating a hexagonal grid you then wanted the centroids for those hexagonal grids you then wanted a grid line to pass through the center of each of those centroids the thing is the distance between the centroids is not uniform in a longitudinal direction although it is uniform in a latitudinal direction so let's just show you how i came up with those measurements so i'm just going to assume a basic measurement first of all let's start off by creating a grid so we're going to create a grid and actually before i even do that so let's just backtrack slightly this grid is going to be in measured in meters so by changing or by adding a google terrain streaming image as our background raster uh it automatically the program automatically changes to pseudo mercator which is epsg 385 now this is in meters so you could go ahead and just start calculating your grid so for instance if we went to vector research tools and then said create grid you'll see it allows you to select meters now let's just show you what could happen if you left this in wgs 84 which is epsg-4326 okay now the same thing let's go and create that grid create grid now you've got some warning signs here and what this is telling you is that the project projection is in decimal degrees so if you type in um 10 meters here it's actually going to calculate 10 degrees and you you're not going to get the results you're expecting so firstly make sure you have the correct projection chosen now uh pseudomecata is fine but for this example i'm going to use hearty burst hook because that is the south african um datum hard to be so and we're going to use the um the meridian or the point of tangency as aloe 19 and east north up that just flips the the view okay so now just by selecting that and you can search for it if you don't have it in your previously used coordinate reference systems just under the filter box here type in uh what is that one zero two five six two and that should take you straight to how to boost l19 east north up okay and the reason i've chosen this one is because that is the closest point of tangency to the area i'm working in so we can say okay and my view will change slightly but now we got it in meters and it'll have the least amount of distortion because it is the point of tangency closest to the area we are working in and that might come up later as well if you are working in a much bigger area and i'll show you how it actually affects your grid so let's go ahead and create our grid now research tools we are going to create a grid it is going to be a hexagon and the grid extent is going to be the let's just use the same as our map canvas extent and the spacing we're going to go for 10 kilometers so that's going to be 10 000 meters and that's in both ways both directions vertical and horizontal 10 000 meters and a temporary layer is fine for my example because i'm just going to delete all this when i'm finished but you may want to create a permanent file and to do that you just click over there and say save to file and choose a place on your hard drive somewhere i'm sure you know how to do that so let's run this and see what it looks like okay there we go so now we've got our hexagonal grid and let's just color this up slightly differently so we can see what's happening so i'm just i just right click on my my toolbar up here actually what you can also do is just double click on the on the icon and it's probably a simpler way and we'll choose a nice uh some nice green and then i'll make it slightly transparent so i'll change the opacity of the color now by changing the opacity of the color here it changes the opacity of the the polygon color it doesn't change the line color so that's why i like that option and there we go so we can still see what's happening underneath we can see cape town we can see paul we can see her bow and the further east we travel we can see a bunch of other things as well okay so the center of our map is kind of this pile area here and i've specifically chosen that for that for this example because pile is very close to the 19th longitudinal meridian okay so so in this projection by choosing how to burst hook 94 lo19 the least amount of distortion will happen for your um your layers okay so your measurements your perimeters areas and and calculations for that that sort of thing are going to have the least amount of distortion here the further east and west you move away from your center point the greater the distortion will become okay so that is something to bear in mind if you are working in an area make sure you choose the projection with a meridian closest to your the center of your study area let's say okay so your next task you were saying it was to create a centroid so i'm just going to click on i've already typed it out here so type on click on centroid select centroid and once again i'm going to create a temporary layer you can create a permanent one if you want and then i will just change the the color of this eso slightly so i can see what's happening maybe yellow will stand out okay there we go okay so there are my centroids now your your request was you wanted a a a line grid that would travel through the centroids for longitude and latitude now that would be easy enough if these centroids were evenly spaced but they aren't they are there's a different measurement if we if we actually have a look at it i'll zoom in over here show you what i mean and what i'm going to do is turn on my snapping tools now this is something you might want to use if you haven't used snapping tools before just right click up here on a blank spot on your menu bar here and then scroll down and choose snapping toolbar and now i want to activate snapping and that will just allow me to snap to various vertices and points and centroids etc so we need to click on the magnet turn on our snapping options click on this option and choose open snapping options and then select all layers advanced configuration now we are going to snap to the centroid and then we also want to snap to the grid but we don't want to snap to the vertex of the grid i want to be able to snap to the midpoint so i want to be able to measure that distance and then that distance to show you that there are you can already see that they are a different length so you wouldn't just be a case where you could put in a uniform grid and then expect to get a uniform result so we are just trying to work out what distance we should put in for our new grid line so what i want to do is be able to snap to the center point of this line segment and there is an option here if you click under vertex and you scroll down and choose middle of segment that will allow you to now do that so now you can turn that off and it should go off there we go and let's just measure that distance so we're going to choose our our measure line tool and that pops up with this little measurement box and we're going to you see the minute the minute we can get close to our centroid a little pink box pops up and that indicates that we are snapped onto that centroid so the distance between there and then the midpoint is essentially the distance between there and there and that comes out at eight six five nine point five one one okay and if we go this way it is close to five kilometers four nine nine nine point six one five meters okay so that distance from the centroid so if you went ahead now and you use those two measurements um for your vector so you could essentially go in here and where's my research tools and then you type in the new values for a line so you select line similar grid extent let's just use our existing map extent okay and what was it it was our first distance our horizontal spacing will be eight six five nine point five one one and then our vertical spacing was four nine nine nine now i don't remember what it was uh point something but let's just leave it like that for now we'll create a temporary grid we'll run that and close so now it's not quite 100 in the middle so what we could do then is first of all let me change this so you can see it you probably can't see it let's make it a bit not that fat 0.4 and a pinky color salmon now you can see it so what you could then do okay now you can see there's your there are your there's your measurements for your for your grid lines is we then select our editing tools okay and there's actually another editing toolbar that we're going to need for this next little section called advanced digitized editing so just right click again once again on your open toolbar spot there select advanced digitizing and then what we are going to do is we are going to select the whole grid and then select the move option but before we do that we want to snap again so we don't choose our snapping options so let's just make sure we open the advanced snapping options and this time we want to use the grid vertex as well okay and then it's just a case of selecting move click on the first vertex move it to the first centroid and there you go now if you look at that from a distance this looks like it's passing through the middle of each of these centroids so job done right now if you're actually happy with that result and that scale and that accuracy then your job is done but if you actually want it to pass through the center of the centroids you're going to see that there's a slight issue here as we get closer to it zoom in you'll see that that distance has actually changed so even though we measured it out up front the distance has changed okay so so it's not going to consistently pass through that centroid and the only way to do that if you had a grid this big would be then to let's uh delete all of this start editing and let's select all and then delete would be to actually draw a line for each one so you you draw these lines like this i'm just going to finish that and then do this one so i'm just snapping to each centroid and another one now you want to avoid this because i imagine you've got quite a big study area and you don't want to be drawing all these lines in it's much easier to use that grid but this is if you wanted to pass through each centroid we use the editing tool and the snapping tool to snap to each centroid but i'm already bored of this and it's probably going to take you all day so let's not bother with that so i'll show you the next best thing i guess is to try and average out that distance but before i do that let me show you why it's actually happening okay so let's start off with uh with that measurement so let's stop editing that for now we're going to use the measuring tool and we're going to measure the distance between the centroids and then the the middle of the uh the line segment okay so the nice thing about this little tool is it'll is it will add up and show you the the previous measurements so let's start here so you can actually see this measurement is changing 8659 and the number is getting bigger and bigger until we get to us our um our central meridian or our point of tangency now you'll see that that line will start that distance will start getting smaller again okay so now it got to 60 around about 19 degrees and then it started changing so so what you could do is you could measure the total distance from there to there all right and then open up a little spreadsheet okay let's open up that spreadsheet and then where can we go go length length columns and then space or value let's say okay so the total length is what's that 181 kilometers eight five nine point one five all right divided by the number of columns so one two three four five oh one i'm gonna have to calculate i'm gonna have to count these right one two three four five six seven eight nine 10 11 12 13 14 15 16 17 18 19 20 21 oh is it 21 i hope it's 21 and then divide the distance so then we'll just go equals this divided by this so this is kind of for your best average right so it's eight six five nine point yeah nine five nine okay so now that is the distance we are going to punch in to that grid calculator okay now now that is for the longitudinal lines what about the latitudinal lines now the latitudinal lines shouldn't change they should be the same and that's because of the projection we we're using is transverse mercator so it's a cylinder so what we're doing is we're getting a spherical shape the earth and we're projecting it onto a flat plane and in this case for transverse mercator the flat plane is a piece of paper or plane that is wrapped around the earth in the form of a cylinder and then it's popped on its side that's why it's called transverse mercator and so the point of tangency is the point that that cylinder then touches the earth and you know what maybe i should maybe [Music] i should quickly draw this okay okay so we've got a round shape that we swell a spherical shape that we need to unwrap and project onto a flat piece of paper or computer screen or whatever we're projecting the globe onto so what they what we've essentially got is we've got a spherical shape and then we've got a a cylinder so a flat piece of paper which is then wrapped around the earth so if i if i had to draw that it would look something like this and then popped on its side so this is popped on its side okay and it's wrapped around the earth like this okay not quite like that and then if you imagine this being a cylinder i'll try and draw a cylinder oh my gosh okay something like that okay so this piece of paper is wrapped around the earth and then where it touches is the point of tangency okay in this instance we're using 19 degrees okay so there we go so now what happens is if you imagine um the cen at the center of the earth is a wire globe and at the center of the earth there is a globe that's on okay so now this is a light bulb and it is shining out through the wire globe onto the piece of paper then you're essentially projecting the round shape onto a flat surface or a flat plane and the further you get away from the point of contact the greater your distortion so i wonder if i've got different colors i can choose here i'm not really that familiar with this with this tool um can i choose a different color something like that okay let's try that so now this this area here is being projected onto that area there and you can see that that distance is not the same as this distance okay so the further you get from your point of contact the greater the distortion will be okay so that's basically what i'm trying to get across here and if we go back to qgis when we ran through that little there we go this little measurement we saw that the closer we got to our point of contact which for lo19 is pile where we're almost in line with paul now it gets to 250 sorry it gets to 866 0.250 from a much smaller value and then starts changing again and so that's the reason that happens so kind of a long-winded way of explaining that but sometimes these are important things to know okay so then it gets smaller again so point of tangency least amount of distortion but what about the latitudinal lines well there there's actually zero distortion okay and let's just prove that by measuring these distances okay uniform distances so nothing changes for latitude okay so that value we're not going to have to change so if we go back to our little equation over here not our equation sorry the little values that we are going to use this one can be 499.526 enter there we go i'm going to drag it off to the side and i am now going to create that grid all right so let's create the grid this one can travel but before i do that i wonder if i can steal the style now delete it okay let's just zoom in like that maybe a bit tighter there we go that looks better and run that research tools create grid again and it is a line the grid extent will be same as the map canvas that's fine now horizontal spacing is going to be that average so it's eight six five nine eight six five nine point nine five nine so that's our best average it's not going to be consistent across the whole way but this one will be four nine nine nine point five two six okay temporary all good let's run that close okay now we've got a whole bunch of bunch of extra ones let's move it again first of all i want to see if i can paste that style that i stole yes i can let's zoom in a little and we will start editing i'm going to select everything and i actually just need to make sure i'm snapping again to the new layer which has been added okay we're going to move everything from that point to that point and then we can deselect save and it should be a lot closer so there will across this uh this length still be some issues but it'll be a bit closer than it was so you see there's still issues but on average it'll be much closer to the centroid so like i said ultimately if you want it to 100 go through the middle of each centroid you're going to have to digitize it manually but if you want to get as close as you as as possible you can use this method yeah so i mean that turned out to be quite a long video but uh i hope you learned something let me know if that works out for you okay cheers
Info
Channel: Q-tips
Views: 521
Rating: undefined out of 5
Keywords: QGIS, QGIS Grid, GIS Hex GRID, QGIS Snapping tools, QGIS Advanced editing tools, QGIS Editing, QGIS CRS, QGIS Projections, GIS Projections
Id: jR65ZeZ9mv0
Channel Id: undefined
Length: 23min 1sec (1381 seconds)
Published: Thu Sep 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.