Learn R Programming

geosphere (version 1.5-20)

lengthLine: Length of lines

Description

Compute the length of lines

Usage

lengthLine(line)

Value

length (in meters) for each 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

See Also

For planar coordinates, see the terra or sf packages

Examples

Run this code
line <- rbind(c(-180,-20), c(-150,-10), c(-140,55), c(10, 0), c(-140,-60))
d <- lengthLine(line)

Run the code above in your browser using DataLab