12.4 Desire lines

Unlike zones, which represent trip origins and destinations, desire lines connect the centroid of the origin and the destination zone, and thereby represent where people desire to go between zones.They represent the quickest ‘bee line’ or ‘crow flies’ route between A and B that would be taken, if it were not for obstacles such as buildings and windy roads getting in the way (we will see how to convert desire lines into routes in the next section).

We have already loaded data representing desire lines in the dataset bristol_od.This origin-destination (OD) data frame object represents the number of people traveling between the zone represented in o and d, as illustrated in Table 12.1.To arrange the OD data by all trips and then filter-out only the top 5, type (please refer to Chapter 3 for a detailed description of non-spatial attribute operations):

  1. od_top5 = bristol_od %>%
  2. arrange(desc(all)) %>%
  3. top_n(5, wt = all)
Table 12.1: Sample of the origin-destination data stored in the data frame object bristol_od. These represent the top 5 most common desire lines between zones in the study area.
odallbicyclefootcar_drivertrain
E02003043E020030431493661296648
E02003047E0200304313002877511488
E02003031E0200304312213056001767
E02003037E020030431186889081103
E02003034E0200304311772817111007

The resulting table provides a snapshot of Bristolian travel patterns in terms of commuting (travel to work).It demonstrates that walking is the most popular mode of transport among the top 5 origin-destination pairs, that zone E02003043 is a popular destination (Bristol city center, the destination of all the top 5 OD pairs), and that the intrazonal trips, from one part of zone E02003043 to another (first row of Table 12.1), constitute the most traveled OD pair in the dataset.But from a policy perspective, the raw data presented in Table 12.1 is of limited use:aside from the fact that it contains only a tiny portion of the 2,910 OD pairs, it tells us little about where policy measures are needed, or what proportion of trips are made by walking and cycling.The following command calculates the percentage of each desire line that is made by these active modes:

  1. bristol_od$Active = (bristol_od$bicycle + bristol_od$foot) /
  2. bristol_od$all * 100

There are two main types of OD pair:interzonal and intrazonal.Interzonal OD pairs represent travel between zones in which the destination is different from the origin.Intrazonal OD pairs represent travel within the same zone (see the top row of Table 12.1).The following code chunk splits od_bristol into these two types:

  1. od_intra = filter(bristol_od, o == d)
  2. od_inter = filter(bristol_od, o != d)

The next step is to convert the interzonal OD pairs into an sf object representing desire lines that can be plotted on a map with the stplanr function od2line().71

  1. desire_lines = od2line(od_inter, zones_od)

An illustration of the results is presented in Figure 12.3, a simplified version of which is created with the following command (see the code in 12-desire.R to reproduce the figure exactly and Chapter 8 for details on visualization with tmap):

  1. qtm(desire_lines, lines.lwd = "all")

Desire lines representing trip patterns in Bristol, with width representing number of trips and color representing the percentage of trips made by active modes (walking and cycling). The four black lines represent the interzonal OD pairs in Table 7.1.
Figure 12.3: Desire lines representing trip patterns in Bristol, with width representing number of trips and color representing the percentage of trips made by active modes (walking and cycling). The four black lines represent the interzonal OD pairs in Table 7.1.

The map shows that the city center dominates transport patterns in the region, suggesting policies should be prioritized there, although a number of peripheral sub-centers can also be seen.Next it would be interesting to have a look at the distribution of interzonal modes, e.g. between which zones is cycling the least or the most common means of transport.