如何在GGR地图上覆盖osmar形状?
我无法用R将osmar形状覆盖在ggmap上 我得到osmar对象(在本例中,它是威斯康星州密尔沃基的湖泊公园): 然后我尝试将其覆盖在地图上:如何在GGR地图上覆盖osmar形状?,r,google-maps,osmar,R,Google Maps,Osmar,我无法用R将osmar形状覆盖在ggmap上 我得到osmar对象(在本例中,它是威斯康星州密尔沃基的湖泊公园): 然后我尝试将其覆盖在地图上: area.points <- fortify(lpp) mapImage <- get_map(location = c(lon = -87.89, lat = 43.05), color = "color", source = "google", zoom = 13) ggmap(mapImage) + geom_
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")
area.points在geom_路径的aes部分添加group=group
,解决了以下问题:
ggmap(mapImage) + geom_path(aes(x=long,y=lat,group=group), data=area.points,
color=colors[9], alpha=0.5)+
labs(x="Longitude", y="Latitude")
[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(mapImage) + geom_path(aes(x=long,y=lat,group=group), data=area.points,
color=colors[9], alpha=0.5)+
labs(x="Longitude", y="Latitude")