lengthLine | R Documentation |
Compute the length of lines
lengthLine(line)
line |
longitude/latitude of line as a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialLines* or SpatialPolygons* object |
length (in meters) for each line
For planar coordinates, see the terra or sf packages
line <- rbind(c(-180,-20), c(-150,-10), c(-140,55), c(10, 0), c(-140,-60)) d <- lengthLine(line)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.