Add buffer, count points, nearest neighbor analysis, and heat map in QGIS 3.10

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there class today we are going to play around more with qgis so let's first add in our csv file for the lights out so let's go to layer add layer the delimited layer and we'll navigate over to that where we're holding our enst456 folder and the data sets and the umd the lights out umd file and we will tell it longitude as x latitude is y we will add it and first thing we'll do is right click in that layer set coordinate reference system set crs and this was originally the wgs84 it has not been projected yet and the datum was wgs 84. now the first thing we want to do is save it save these features as a shape file before we do anything else so again let's navigate to that data set folder let's call it l-o-u-m-d underscore export and save all right now we want to project it so let's go to processing so we can open up that toolbox let's type in project and we'll find under a vector because now we've saved it as a vector shape files are vectors so under vector general we can click on re-project layer we want to make sure we navigate to the exported shape file for our target coordinate reference system now we want it as projected into utm zone 18. so we can start to type in utm get to utm space zone and we'll see two options either the datum could be set on wgs 84 or nad 83 obviously we will select wgs 84 and hit ok we want to save that layer again to that data sets file or subfolder let's call it l o umd now let's do underscore utm so we remember this is our shape file it's been projected into utms we hit run and close now just for good measure let's remove the layers that we do not need so we don't need that originally exported shapefile and we also don't need the csv file so we're going to remove both of those so we just have lights out umd so there's a few things we're going to play with so under vector let's go to geoprocessing tools let's say we are interested in looking at a 50 meter buffer so we're going to add 50 meters around every single one of these locations so under vector geoprocessing tools let's go to buffer and for that input layer we'll make sure we select our utm shapefile layer of those points for distance let's say make sure we're in meters let's increase this to 50. for segments let's make this more like 25 to help it be more rounded and then for location to save it save this layer we'll go to those three dots save to file again let's save it to that data sets folder and now let's call it l-o-u-m-d underscore 50 m buff and let's hit save and run so now it's those same exact points just we have that 50 meter buffer and we can drag this below so we can see the points plus the 50 meter buffer around each point all right let's also add in that layer the university of maryland boundary that we created in google earth let's go to layer add layer add vector because remember shapes lines polygons are vectors let's go to that university maryland boundary kml shape that we turned into a shapefile so this is the boundary that we previously created and let's say we're interested in seeing uh in performing a count how many of these points that we saw lie within our boundary so our results may differ slightly depending on how we drew our boundary but let's say that's our our question is how many of these points are within my boundary so we'll go to vector analysis tools count points in polygon we will click on that for the polygon that would be the universal maryland boundary for points let's say we want those the lights out umd as our points and the count let's save this to a file let's keep it as our data set i'm going to call it lou md underscore points and let's hit save and run now let's right click on this points shapefile open attribute and we will scroll to find our answer so there were 33 points within our shapefile but is that all of them so let's go back to that utm file go right click on it go to open attribute table and here we see there's 34 points so not every single point was within our boundary and we see that when we zoom when we right click and zoom to layer we do see that there is this one point right here that was not counted so that's just a quick way to count points within a certain area that you're interested in as long as you have a polygon or some kind of shape of interest that's a fun tool you can do quickly now let's say you are interested in running statistics of some kind of field so let's look again at our attribute table so right click open attribute table we have fields such as date latitude longitude location so the name of the building and the bird species so let's say we want to run the mean value what was the mean longitude of our birds that collided with buildings so we go to vector analysis tools basic statistics for fields and we tell it the correct layer so that utm projected layer and let's say we're interested in the longitude so the field to calculate our statistics on is longitude and let's save this file within our data set folder and let's call it loumd underscored long long for longitude underscore stats and we're going to save it we're going to run it and it's going to pull up with this path right here this pathway let me move myself out of the way so you can click on this pathway right here that pops up with our result and we see the mean was negative 76.946 so that was uh west of the prime meridian so here are values so it popped up in this pathway over here okay so now let's say we're interested in the points again let's zoom to all the points let's let's see that um let's say we're interested in looking at the distribution of all these locations are they clumped in certain areas or are they randomly dispersed or are they evenly dispersed so to figure that out we're going to go to vector analysis tools nearest neighbor analysis we will keep our utm projected so it has to be a projected file so we will make sure we navigate to our projected file and for nearest neighbor we're going to save the results to our data sets and let's call it l-o-u-m-d underscore neighbor and this is also gonna when it runs it's gonna save as this pathway over here this html file so let's click on that and see our results all right so it is comparing the locations with um expected random locations to see that uh distribution how it compares between each point so it's saying that the nearest neighbor index is 0.3098 now let's talk a little bit about these these results so if our index is much less than one then we see it as clustered if it's right around one then we see it as randomly located and if it's much larger than one then we see it as evenly dispersed so in this case it's much less than one so we're seeing these results as being clustered rather than random and our z-score so it's not a p-value it's a it's a z-score and we're looking at the absolute value of the z-score so the larger the absolute value the more confident we are that these were statistically significant so if we had a z-score really really small in um like the tenths or a hundredths um we wouldn't feel very confident about it but as we get larger and larger in absolute value then we get more confident so in this case we see that our nearest neighbors indicating these are uh clumped rather than randomly distributed and we we do see that we do see some clumping going on in a few different sections and we can also run a heat map to see where these areas of high density are so if we type in heat map in our toolbox we can click on that we make sure we load in that projected layer we'll keep that kernel shape for the heat map let's save that again to the data sets let's call it l-o-u-m-d underscore heat and let's run that okay and again it also notices this clumping so it's seeing these um or it's displaying the bright white areas as indicating areas with a lot of uh locations so the dark areas are representing more independent locations whereas the wider we get or the brighter we get that's indicating a larger density of these locations so that's just a few other things we can do with qgis i will give you another data set to play with and then you can work through these steps to be able to answer the quiz and discussion
Info
Channel: Shannon Pederson
Views: 549
Rating: 5 out of 5
Keywords:
Id: 8Wa6-iYE4KQ
Channel Id: undefined
Length: 13min 46sec (826 seconds)
Published: Mon Feb 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.