It is common to want to know the Euclidean distance between origins and destinations
in OD data. You can calculate this by first converting OD data to SpatialLines data,
od2line. However this can be slow and overkill if you just
want to know the distance. This function is a few orders of magnitude faster.
A data frame representing the flow between two points
or zones. The first two columns of this data frame should correspond
to the first column of the data in the zones. Thus in
A SpatialPolygonsDataFrame or SpatialPointsDataFrame representing origins (and destinations if no separate destinations object is provided) of travel flows.
Note: this function assumes that the zones or centroids in
cents have a geographic
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.