Skip to contents

Returns a two point linestring joining each start to the matching end. ga_make_line() recycles end, so you can pair one destination with every origin.

Usage

ga_make_line(start, end)

Arguments

start

a GeoArrow point array

end

a GeoArrow point array; length 1 or the same length as start

Value

a GeoArrow linestring array of the same length as start

Details

ga_make_line() returns a null element for a null or empty point on either side, so the result is always the same length as start. The length of the line is ga_length_euclidean(), which equals ga_dist_euclidean_pairwise() on the same pair.

Examples

start <- ga_point(c(0, 0), c(0, 3))
end <- ga_point(c(4, 4), c(0, 3))

as.vector(ga_length_euclidean(ga_make_line(start, end)))
#> [1] 4 4