[R-sig-Geo] Calculate distance along a path
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Tue Jan 28 17:23:07 CET 2014
On Tue, Jan 28, 2014 at 3:14 PM, Rafael Wüest <rafael.wueest at gmail.com> wrote:
> http://rpubs.com/geospacedman/routing
>
> could be a start...
>
> Hope this helps,
Looks good.
You need three data sets - a line data set of the paths, a point data
set of the bus stops, and a point data set of the grids.
From line data set you build a topological graph with distance as edge weights.
Snap the bus stop and grid centres to the nearest point on a path.
Do shortest-distance path search between grid cells and bus stops.
It would be useful to know how complex your path network is, and how
many grid cells you want to do, and how many bus stops you have. But
in principle all the functions are there in the igraph, sp, and rgeos
packages (and a few others).
R is a construction kit....
Barry
More information about the R-sig-Geo
mailing list