powered by
The shortest Great Circle distance between pairs of geometries
shortest_distance_to_line(x, line, ellipsoidal = FALSE)
numeric. Shortest distance in meters
objects of class sfg, sfc or sf
sfg
sfc
sf
Logical. Whether the distance is calculated using spherical distances (sf::st_distance()) or ellipsoidal distances (lwgeom::st_geod_distance()).
sf::st_distance()
lwgeom::st_geod_distance()
plate_boundary <- subset(plates, plates$pair == "na-pa") shortest_distance_to_line(san_andreas, plate_boundary) |> head()
Run the code above in your browser using DataLab