R で osmar ナビゲーション デモを実行しようとしています。このデモでは、osmar と igraph を使用して、openstreetmap データに基づいてミュンヘン市内中心部周辺の交通ルートをプロットします。
LubuntuでRバージョン3.1.1を使用しています
デモと osmar ライブラリの詳細については、http: //journal.r-project.org/archive/2013-1/eugster-schlesinger.pdf を参照してください。
入力したデモを実行するには、
library("osmar")
library("igraph") # The demo tries to call igraph0, but this is
# no-longer available in my version of R, so I
# have changed it to "igraph"
demo("navigator")
デモは、igraph セクションに到達するまで完全に実行されます。
gr_muc<-as_igraph(hways_muc) # make a graph of the highways from openstreetmap
summary(gr_muc)
これは戻るはずです
Vertices: 2381
Edges: 2888
Directed: TRUE
No graph attributes.
Vertex attributes: name.
Edge attributes: weight, name.
しかし、私にとっては戻ります
IGRAPH DNW-2385 2894 --
attr: name (v/c), weight (e/n), name (e/n)
コマンドとがエッジと頂点のリストを返すgr_mucため、これがグラフであることがわかります。E(gr_muc)V(gr_muc)
その後、デモが実行されます
route <- get.shortest.paths(gr_muc,from = as.character(hway_start_node),to = as.character(hway_end_node))[[1]]
そしてエラーを返します
At structural_properties.c:4482 :Couldn't reach some vertices
つまり、開始頂点と終了頂点をリンクできませんでした。その後、スクリプトは失敗します。
デモ スクリプトを実行するには何を変更すればよいですか? また、機能しないのはなぜですか?

