Calculate a distance matrix between all pairs of a given list of points
distance_matrix(graph, xy)
graph | Graphs extracted from download_graph. |
---|---|
xy | Matrix of two columns containing latitudes and longitudes of points between which distances are to be calcualted. |
A list of two items: A matrix of distances between all pairs of
points listed in xy
, and an index of points in xy
which map on
to unique graph nodes. The distance from point a
to point b
is
`$d [a, b]`.
Different points may map on to the same network locations, in which
case they are excluded from distance calculation. The function returns an
index which can be used to directly extract the xy
points which map on
to unique locations.