An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110804/d416b134/attachment.pl>
Highway Distance matrix
3 messages · Raphael Saldanha, lubinbin220 at gmail.com, Roger Bivand
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110804/843a1676/attachment.pl>
On Thu, 4 Aug 2011, lubinbin220 at gmail.com wrote:
Hi, I agree with Jeremy, but it seems that it's not very handy to use igraph to compute the shortest path. I have developed a package "shp2graph"to transform a road network data set from a SpatialLinesDataFrame. Based on this, I have writen a guide to compute the shorest path in R, which is available at the following link: https://sourceforge.net/projects/shp2graph/files/Guide%20for%20computing%20shortest%20paths%20with%20given%20points%20and%20base%20network%20map.pdf/download If any queries, please email me. Any comment or suggestion is welcome.
And note that it will be presented at useR! in Coventry (UK) on Wednesday 17 August, 16.00 - 17.05, B3.03, with other spatial papers (see also 11.15 - 12.35, B3.02 same day). All welcome! Roger
Binbin On , Raphael Saldanha <saldanha.plangeo at gmail.com> wrote:
Thanks Jeremy! I will take a good look on this.
On Thu, Aug 4, 2011 at 11:36 AM, jeremy.raw at dot.gov> wrote:
There is certainly no need to go anywhere near ArcGIS for this type of
operation.
The simplest approach would be to look at one of the packages that does
shortest path evaluations on a network. On CRAN, the igraph package
lets you can do this pretty straightforwardly. Alternatively, the
travelr package on R-Forge (not actively maintained, but functional for
this purpose) is also available. Igraph is easier if you are
comfortable with basic graph theory (and translating to and from the
0-based indexing that the current version of igraph uses for node/vertex
numbering), whereas travelr may be easier if you are already comfortable
with transport modeling.
The basic steps are to convert your base map into a suitable
graph/network format (eg via what igraph calls an edgelist) and then
to use shortest.paths in igraph, or build.paths and skim.paths in
travelr, to compute the matrix of distances.
Igraph also has a help list where some of the set-up questions for this
type of problem have already been addressed:
I hope that helps!
Jeremy Raw, PE
FHWA Office of Planning
jeremy.raw at dot.gov
(202) 366-0986
-----Original Message-----
From: r-sig-geo-bounces at r-project.org
[mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Raphael Saldanha
Sent: Thursday, August 04, 2011 7:32 AM
To: r-sig-geo
Subject: [R-sig-Geo] Highway Distance matrix
Hi,
How can I compute a distance matrix of points (citys) based on a highway
base map?
Regards in advance,
Raphael Saldanha
saldanha.plangeo at gmail.com
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
--
Atenciosamente,
Raphael Saldanha
saldanha.plangeo at gmail.com
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand Department of Economics, NHH Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no