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 is the crux of GIS. It allows us to answer complicated questions in relation 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.

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 into QGIS.
  • Open the attribute table of the police station layer and crime and note the column values and attribute information.
  • Open the properties of the police station layer and create a join with the crime layer using the join column.
  • Open the attribute table of the police station layer and inspect the join.
    Why are the joined fields empty or null?. Can you fix the issue affecting the join between the two layers?
  • Are all the records from the crime layer visible within the police station after your fix?
  • Navigate to the properties of the police station layer and delete the join you have created above.
  • Create a virtual layer called police_crime using the SQL given below.

Questions

  • How many police station occur within each district? Use the count algorithm. What other alternative methods exist to count the number of features that occur within a polygon.
  • What is the total length of all roads?
  • What is the total length of all roads in each district. Use the Sum algorithm
  • Using the virtual layer police_crime create a bar plot indicating how a specific crime type reported at a particular police station varies over time.
    Example: Carjacking reported at Alexandra Road between 2013 and 2014.
    Hint Use the Diagrams options from the layer properties or the QGIS plugin Plotly

Name Expectation

Count Algorithm

Points In polygon

Sum Algorithm

Sum line lengths

Diagram

Bar Chart

Virtual layer SQL

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

Diagram Plugin

Data Plotly

join column

name

More about statistical analysis

Spatial statistics allows you to interrogate the data and produce useful insight or trends about the data. In QGIS you can use native tools like Basic Statistics to generate statistics for numerical values. The QGIS expression dialogue also allows users to interrogate the data either directly using attributes or the geometry of the 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 histograms.

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 even though the attributes differ
    2. Joins are sensitive to word cases i.e. Upper Case or Lower Case
    3. Joins can only be done between spatial layers
  2. Spatial statistics can only be used with the following data types:

    1. Vector data only
    2. Raster data only
    3. Combination of raster and vector data
  3. Which of the following data types can be used with the statistical summary tool:

    1. Text
    2. Boolean
    3. Decimal