Learn R Programming

stplanr (version 0.2.8)

od_coords2line: Convert origin-destination coordinates into desire lines

Description

Convert origin-destination coordinates into desire lines

Usage

od_coords2line(odc, crs = sf::st_crs())

Arguments

odc

A data frame or matrix of representing the coordinates of origin-destination data. The first two columns represent the coordinates of the origin (typically longitude and latitude) points; the second two columns represent the coordinates of the destination (in the same CRS). Each row represents travel from origin to destination.

crs

A number representing the coordinate reference system of the result.

See Also

Other od: dist_google, od2line, od2odf, od_aggregate, od_coords, od_dist, od_radiation, points2flow, points2odf, sp_aggregate

Examples

Run this code
# NOT RUN {
odf <- od_coords(l = flowlines_sf)
odlines <- od_coords2line(odf)
odlines <- od_coords2line(odf, crs = 4326)
plot(odlines)
# }

Run the code above in your browser using DataLab