length_euclidean | R Documentation |
For a given LineString or MultiLineString geometry, calculate its length.
Other geometries will return a value of NA
.
length_euclidean(x)
length_geodesic(x)
length_vincenty(x)
length_haversine(x)
x |
an object of class |
Vicenty, Geodesic, and Haversine methods will return in units of meters.
Geodesic length will always converge and is more accurate than the Vicenty methods.
Haversine uses a mean earth radius of 6371.088 km.
See geo
docs for more details.
A numeric vector
set.seed(0)
y <- runif(25, -5, 5)
x <- 1:25
ln <- geom_linestring(x, y)
length_euclidean(ln)
length_geodesic(ln)
length_vincenty(ln)
length_haversine(ln)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.