The Frechet distance measures the similarity between two curves by considering the location and ordering of points along each curve. Uses the Euclidean metric.
Examples
# a straight route against one that detours north
direct <- geoarrow::as_geoarrow_array(sf::st_sfc(
sf::st_linestring(rbind(c(0, 0), c(2, 0), c(4, 0)))
))
detour <- geoarrow::as_geoarrow_array(sf::st_sfc(
sf::st_linestring(rbind(c(0, 0), c(2, 1), c(4, 0)))
))
as.vector(ga_dist_frechet_pairwise(direct, detour))
#> [1] 1