[R-sig-Geo] managing road network

Sébastien Ollier sebastien.ollier at u-psud.fr
Wed May 9 09:18:12 CEST 2007


Dear UseRs,

I am working on a road network of an agricultural landscape and I want 
to find the shortest path between two points on that network.
The road network is currently on an polyline form, each road being 
represented by a polyline.
To do that, I have thought to convert my polyline theme into a spatial 
graph and use for example the function shortest.path of the package 
igraph. SO, I need to :
- import the shapefile into R (not a problem with R)
- convert the polyline into a graph : I need to find the crossings of 
the polyline and define them as the vertice of the graph (nb lass of the 
package spdep, neig class of the package ade4, or igraph of the package 
igraph...maybe another class of another package?). Then I will cut the 
polyline btween vertices and define the edge of the graph.
- find the shortest path in a graph (using the function shortest path of 
the package igraph...maybe another function of anpother package)
I think I will manage to do it like this but I would like to know if 
there is a cleaver, or a shortest way to do this with R.
Thanks for you experience,

Sébastien Ollier
Université Paris-Sud
France




More information about the R-sig-Geo mailing list