Spatial analysis in Context

“Spatial analysis is the process of analysing the relationship between locations, attributes, and the relationship of features through analytical techniques. Spatial analysis defines the relationship b”

This module looks at a variety of spatial analysis techniques that can be used to answer geographic questions.

You try:

Goal: You are a resident of a neighbourhood and have been provided with crime data and police stations data. Use the datasets to answer interesting questions about your area.

  • Load the data provided. Add the csv using the vector menu.
  • Filter the layers to show features that are within the districts layer (do spatial selection and save the selected features as new layers). Do this for roads and police stations.
  • Join the crime layer to the police station.
  • Open the police station and notice the joined records. Why is the table empty.
  • Fix the issue with the join so that all records are shown in the police station.

Questions:

  • How many police stations occur within each district. Use count algorithm.
  • What is the length of each road segment. Use a suitable length expression based on CRS of the layer.
  • What is the total length of all roads in each district. (Sum algorithm)
  • Using the crime statistics to show how each crime category has varied of over the years. (create a virtual layer between the police station and crime layer.)

Name Expectation

Data

crime.csv from stats-analysis, police_stations, districts, ne_10m_roads from stats-analysis/ne.sqlite

Count Algorithm

Points In polygon

Sum Algorithm

Sum line lengths

length expression

$length or length($geometry)

Diagram

Bar Chart

Virtual layer

select a.*,b.geometry from crime as a join police_station as b on a.name = b.name

More about

Spatial analysis is the crux of GIS. It allows us to answer complicated questions that with relations to spatial data. When undertaking spatial analysis it is important to categorize the problem and define the category of tools you will be using. Effective spatial analysis requires an intelligent user.

Layers a loaded in QGIS does not show the geometry definition in the attribute table. QGIS can still access the geometry for the layers and through this, some spatial operations can be done which are based on the geometry of the layers. Example of geometry functions available in QGIS include $area used to calculate the area of polygons and $length which is used to calculate the length of line features.

Because humans are very good at interpreting visual data it is important to provide the outputs visually. Symbolisation acts as a nice visualisation tool. QGIS provides diagram tools for visualisation. The tools available are pie charts and Histogram.

Check your knowledge:

  1. Which statement is true with regards to attribute based join:

    1. Joins are possible when two tables contain an identical column name
    2. Joins are sensitive to word cases i.e. Upper Case or Lower Case
    3. Joins can only be done between spatial layers
  2. Which of these is an example of spatial operation:

    1. Assigning colour symbols to a vector layer
    2. Assigning colour symbols to a raster layer
    3. An administrative polygon that has been clipped to show a subset of the data
  3. Can you see the geometry definition of features in the attribute table:

    1. True
    2. False