leastcostpath (version 1.8.7)

validate_lcp: Calculate accuracy of Least Cost Path

Description

Calculates the accuracy of a Least Cost Path using the buffer method proposed by Goodchild and Hunter (1997).

Usage

validate_lcp(lcp, comparison, buffers = c(50, 100, 250, 500, 1000))

Value

data.frame (base package). The resultant object identifies the percentage of the lcp within x distance (as supplied in the buffers argument) from the provided comparison object.

Arguments

lcp

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

comparison

SpatialLines* to validate the Least Cost Path against.

buffers

numeric vector of buffer distances to assess. Default values are c(50, 100, 250, 500, 1000).

Author

Joseph Lewis

References

Goodchild, F. M., and G. J. Hunter, 1997. A Simple Positional Accuracy Measure for Linear Features. International Journal of Geographical Information Sciences, 11(3), 299-306.

Examples

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

val_lcp <- validate_lcp(lcp = line1, comparison = line2, buffers = c(0.1, 0.2, 0.5, 1))

Run the code above in your browser using DataLab