1

R を使用して ggmap に osmar 形状を重ねるのに問題があります。

osmar オブジェクトを取得します (この場合は、ウィスコンシン州ミルウォーキーのレイク パークです)。

lp<-get_osm(relation(6044259), full=T)

私はそれを形に変換します:

lpp<-as_sp(lp, "lines")

これは問題なく、公園の輪郭が見えます。

[plot(lpp)][1]

次に、これを地図に重ねてみます。

area.points <- fortify(lpp)
mapImage <- get_map(location = c(lon = -87.89, lat = 43.05),  color = "color",           source = "google",  zoom = 13)
ggmap(mapImage) + geom_path(aes(x=long,y=lat), data=area.points, color=colors[9], alpha=0.5)+labs(x="Longitude", y="Latitude")

地図と公園のエリア オーバーレイをプロットすると、公園の輪郭がきれいにプロットされず、各ポイント間に線がプロットされているようにも見えます。

ggmap出力

4

1 に答える 1