gradePenaltyFn {roads}R Documentation

Grade penalty edge weight function

Description

Method for calculating the weight of an edge between two nodes from the value of the input raster at each of those nodes (x1 and x2), designed for a single DEM input. The method assumes an input weightRaster in which:

Usage

gradePenaltyFn(
  x1,
  x2,
  hdistance,
  baseCost = 16178,
  limit = 20,
  penalty = 504,
  limitWeight = NA
)

Arguments

x1, x2

Number. Value of the input raster at two nodes.

hdistance

Number. Horizontal distance between nodes. hdistance, x1, and x2 should have the same units.

baseCost

Number. Construction cost of 0% grade road per km.

limit

Number. Maximum grade (%) on which roads can be built.

penalty

Number. Cost increase (per km) associated with each additional % increase in road grade.

limitWeight

Number. Value assigned to edges that exceed the grade limit. Try setting to a high (not NA) value if encountering problems with disconnected graphs.

References

Anderson AE, Nelson J (2004) Projecting vector-based road networks with a shortest path algorithm. Canadian Journal of Forest Research 34:1444–1457. https://doi.org/10.1139/x04-030

Examples

gradePenaltyFn(0.5,0.51,1)
gradePenaltyFn(0.5,0.65,1)
# grade > 20% so NA
gradePenaltyFn(0.5,0.75,1)

[Package roads version 1.2.0 Index]