lengthLine function

Length of lines

Length of lines

Compute the length of lines

lengthLine(line)

Arguments

  • line: longitude/latitude of line as a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialLines* or SpatialPolygons* object

Returns

length (in meters) for each line

See Also

For planar coordinates, see the terra or sf packages

Examples

line <- rbind(c(-180,-20), c(-150,-10), c(-140,55), c(10, 0), c(-140,-60)) d <- lengthLine(line)
  • Maintainer: Robert J. Hijmans
  • License: GPL (>= 3)
  • Last published: 2024-10-04

Useful links