Learn R Programming

leastcostpath (version 1.7.4)

PDI_validation: Calculate Path Deviation Index

Description

Calculates the Path Deviation Index of a Least Cost Path and a comparison SpatialLines using the method proposed by Jan et al. (1999).

Usage

PDI_validation(lcp, comparison)

Arguments

lcp

SpatialLines* (sp package). Least Cost Path to assess the accuracy of. Expects object of class SpatialLines.

comparison

SpatialLines* to validate the Least Cost Path against. Expects object of class SpatialLines.

Value

SpatialPolygonsDataFrame (sp package). Area between the lcp and comparison SpatialLines* with a data.frame containing the PDI, normalised PDI and the distance of the shortest path between the origin and destination

Details

The Path Deviation Index measues the deviation (i.e. the spatial separation between paths) between a pair of paths and aims to overcome the shortcomings of measuring the percentage of coverage of a least cost path from a comparison path (for example, the validation_lcp function).

The index is defined as the area between paths divided by the distance of the shortest path between an origin and destination. The index can be interpreted as the average distance between the paths.

Path Deviation Index = Area between paths / length of shortest path

The value of the Path Deviation Index depends on the length of the path and makes comparison of PDIs difficult for paths with different origins and destinations. This can be overcome by normalising the Path Deviation Index by the distance of the shortest path between an origin and destination.

Normalised PDI = PDI / length of shortest path x 100

The normalised Path Deviation Index is the percent of deviation between the two paths over the shortest path. For example, if a normalised PDI is 30 percent, it means that the average distance between two paths is 30 percent of the length of the shortest path. With normalised PDI, all path deviation can be compared regardless of the length of the shortest path.

References

Jan, O., Horowitz, A.J., Peng, Z,R. 1999. Using GPS data to understand variations in path choice. Paper presented at the 78th meeting of the Transportation Research Board, Washington. Available at: https://pdfs.semanticscholar.org/22bb/3ae1c37632eeee7b6e3b8d973fdaf534f9ab.pdf?_ga=2.242461442.1085768207.1593946556-1126142591.1590329375

Examples

Run this code
# NOT RUN {
x1 <- c(1,5,4,50)
y1 <- c(1,3,4,50)
line1 <- sp::SpatialLines(list(sp::Lines(sp::Line(cbind(x1,y1)), ID='a')))
x2 <- c(1,5,5,50)
y2 <- c(1,4,6,50)
line2 <- sp::SpatialLines(list(sp::Lines(sp::Line(cbind(x2,y2)), ID='b')))

val_lcp <- PDI_validation(lcp = line1, line2)
# }

Run the code above in your browser using DataLab