shortest_distance_to_line: Shortest distance between pairs of geometries

View source: R/trigonometry_degrees.R

shortest_distance_to_lineR Documentation

Shortest distance between pairs of geometries

Description

The shortest Great Circle distance between pairs of geometries

Usage

shortest_distance_to_line(x, line, ellipsoidal = FALSE)

Arguments

x, line

objects of class sfg, sfc or sf

ellipsoidal

Logical. Whether the distance is calculated using spherical distances (sf::st_distance()) or ellipsoidal distances (lwgeom::st_geod_distance()).

Value

numeric. Shortest distance in meters

Examples

plate_boundary <- subset(plates, plates$pair == "na-pa")
shortest_distance_to_line(san_andreas, plate_boundary) |>
  head()

tectonicr documentation built on June 8, 2025, 11:33 a.m.