From the course: Advanced QGIS Analysis with AI and Machine Learning
Introduction to vector analysis - QGIS Tutorial
From the course: Advanced QGIS Analysis with AI and Machine Learning
Introduction to vector analysis
QGIS has a whole host of vector analysis tools. One of the key analysis tools is the buffer. In the processing toolbox, I usually type "buffer" to find the buffer tool. The buffer tool allows me to take a layer, say "Crime", and buffer it a number of units. It could be degrees or it could be units such as meters or feet. And then I can end up with "Buffers". In this case I was buffering pressure pipes. You can see here I buffered each pressure pipe with a particular distance, maybe ten meters. Around every single pipe it has its own polygon. And that's a very useful tool to get an area around a linear or point object. In fact, you can buffer almost anything that's in vector: point, line or polygon. Another handy tool is counting the number of points that fall within a polygon. In this case, I've got a number of points in these polygons. So I found all the industrial areas and I wanted to count how frequently crime happened. That's a point in polygon. So there's a point in polygon. "Count points in polygon", there it is. Basically you say, "What's the polygon?" So I said "Industrial" and I chose "Crime". And then you could weight it and create an output field. And what you end up with is a point in polygon analysis. And I can actually pick on that, and it will tell me how many points intersect with that. Let's make sure I'm picking on the count. Let's try that again. Yeah. Number of points. There's six crime points in this one. This one there's only two. So you can see depending on the point you pick there's no crime points there and zero there as well. So "Count points in the polygon" sums up for a particular polygon how many instances of a particular thing is. In this case it was just how much crime is in an industrial park. So that's a very useful "Count points in polygon" analysis. Another analysis is a spatial join. This is a special tool that does a spatial analysis, but the result set is just the original layer you want to choose with the data from the other. So what I wanted to do is, I'll do a spatial join. And what I did was I took the buildings and overlaid it with parcels. And so what we have is we have buildings intersected with parcels. And now you can say if it contains parcels or it's equal to parcels and so on. But in this case I just said the buildings intersect with parcels. And what I want is the attributes. So I ran this analysis. And now when I pick on these buildings, you'll see that this building has all the information from the original, but it also has the address and street number and house number that's inherited from the parcel itself. Now all the buildings on here will have the same address, right? They all say 80 Tenth Street. This one should say 80 Tenth Street as well, 80 Tenth Street and so on. So all these buildings have a spatial join with the underlying parcel to harvest the data from the parcels. So basically I can take whatever information of the object underneath it and done a spatial join. That's a really handy tool to move data from one layer to another. Now, if you want a more permanent measure, we can do things like an intersection or an overlay analysis. Now there's all sorts of overlay analysis. There's Clip. There's Differences. There's Intersections. There's Union, where you combine them. In this case I've done a multiple intersection. So I took the parcels. And then I did multiple layers. I basically took my buffered parks. And I took my residential zones and basically intersected all three. And what I end up with is a layer that combines the residential zones, I'll show you right here an intersection, that basically harvests everything. The graphic, as well as the house number from the parcel, the zoning from the residential, and then also the park ID and all that sort of information. So I get the park it's on. So I end up with not only the data from all three, but I also get the spatial results. So that's part of a vector overlay. Finally, another tool that is used frequently is the network tools. And we have two network tools. Let's type in "network" here, in the processing toolbox. We have two main ones: a shortest path, basically, what's the shortest path from A to B. And you can do two different types. The shortest path could use the shortest or fastest. The fastest takes into account one-way streets, and also the speed of the road where shortest is just A to B along the line. The other type of tool we have is called the service area. The service area, basically, you pick the point, the road center lines, and then you pick a start point. It could be anywhere, like that. And then based on the values of the road, it'll say how far you can get within a particular time. So this is how far I could get with a half an hour from a point. So like if this is my launch point, how far can I deliver a pizza to half an hour from that location? So network analysis gives me the shortest path as well as a surface area. So you can see we have buffers, point in polygon, spatial joins, overlay intersection and networks. And that's not all. But these are most of the common vector analyses that we're going to be doing inside a QGIS.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.