distance_matrix: Calculate a distance matrix between all pairs of a given list...

Description Usage Arguments Value Note

Description

Calculate a distance matrix between all pairs of a given list of points

Usage

1
distance_matrix(graph, xy)

Arguments

graph

Graphs extracted from download_graph.

xy

Matrix of two columns containing latitudes and longitudes of points between which distances are to be calcualted.

Value

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]'.

Note

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.


osm-router/osmprob documentation built on May 24, 2019, 4:53 p.m.