Chapter 8 Crime Along Spatial Networks
In the previous chapter we explored how the techniques for spatial pattern analysis can be used to study the varying intensity of crime across space. We introduce the key idea of spatial randomness. These methods were developed to study locations in a continuous plane and are also referred to as planar spatial analysis. Point crime data, however, has an inherent structure to it. There are parts of our study region where crime points cannot appear. Since typically the data will be geocoded at the street level address, crime data almost always will appear alongside the spatial network of roads and streets. Crimes won’t appear randomly anywhere in our two dimensional representation of the city; they will only appear along the street network covering this city. We can see this in the following example from Chicago using data from
spatstat:

Clearly the offences are constrained to only occur along the street network. This is not a homogeneous Poisson process along the whole study surface, because there is an underlying structure. If we want to investigate heterogeneity on intensity, for example, we would need to account for that underlying structure, the fact that the points can only be located along the network and not in other parts of the study region. Several authors have argued that crime is best represented and predicted if we focus in the street network rather than other kind of level of aggregation and that this has clear implications for operational policing ([Singleton and Brunsdon, 2014]; [Rosser et al., 2017]). It is clear that if our crime occurrences are collected and represented along a spatial network, we need to ensure we use techniques of analysis and visualisation that respect this existing underlying structure in our data.
The software infrastructure for spatial analysis along networks, however, is still not as developed and consolidated. Partly, this is to do with the statistical and computational challenges when we move from planar to linear network analysis. There is some software such as SANET that was originally conceived as a toolbox for ArcGIS but with a beta standalone version already available ([Okabe and Sugihara, 2012]). R users and developers are working to expand the functionality of R in this regard. It was only in 2020 that Lucas van der Meer, a Dutch spatial data scientist, published the first release of the
sfnetworks package to facilitate the creation and analysis of spatial networks. Two other useful packages (SpNetPrep and DRHotNet) developed by Briz-Redón and colleagues are also only a couple of years old ([Briz-Redón et al., 2019a]; [Briz-Redón et al., 2019b]). Another recent package, released in 2021, is spNetwork by Jeremy Gelb and Philippe Apparicio that can be used for kernel density estimation along networks ([Gelb, 2021]). Finally, the package spatstat, covered in the last chapter, also provides functionality for the analysis of events along spatial networks.
In this chapter we will provide an introduction to the study of crime along networks by exploring the following:
-
creation of network representations from geographical vector objects
-
linking data to meaningful micro-places such as street segment (or in a transportation example, train line segment) or street junction (or for transport research a train or bus station)
-
introducing the idea of hot routes
-
evaluating crime concentration in these types of micro-places using Gini coefficient and Lorenz curve
-
street profile analysis – an alternative (non-spatial) way to visualise crime along a network
-
introducing
spatstatfor the analysis of events along networks
# Packages for reading data and data carpentry
library(readr)
library(readxl)
library(janitor)
library(tidyr)
library(dplyr)
library(tibble)
library(lubridate)
# Packages for handling spatial data
library(sf)
library(lwgeom)
library(sfnetworks)
library(spatstat)
library(spatstat.linnet)
library(maptools)
# NOTE: maptools is still required for the as.linnet.SpatialLines() function,
# but will be retired by the end of 2023. Look out for where
# as.linnet.SpatialLines() function will migrate!
# Package for computing Lorenz curve
library(ineq)
# Packages for visualisation and mapping
library(ggplot2)
library(ggpubr)
library(raster)
library(leaflet)
# Packages providing access to data
library(osmdata)
library(tigris)
It is not only in the case of street networks that understanding spatial point patterns along a network might be more meaningful; there are other networks we might want to consider. Transport networks are a good example of this and are receiving an increasing interest in criminology and crime analysis ([Newton, 2008]; [Tompson et al., 2009]; [Ceccato, 2013]).
