如何使用 R 中的 ggmap 获取具有特定最小和最大纬度和经度限制的 map ?
我刚开始使用 ggmap,到目前为止我已经能够实现这个:
center <- c(mean(src$longitude),mean(src$latitude))
zoom <- min(MaxZoom(range(src$latitude),range(src$longitude)))
hdf <- get_map(location=center,zoom=zoom)
帮助文件说位置可以作为地址、经度/纬度对(按顺序)或左/下/右/上边界框来提及。我找不到任何关于在线实现 ggmap 边界框的有用 Material 。
最佳答案
我不确定你可以在下载阶段做到这一点,但是在绘图阶段怎么样:
map <- get_map()
p1 <- ggmap( map )
p2 <- ggmap( map )+
scale_x_continuous( limits = c( -95.5 , -95.3 ) , expand = c( 0 , 0 ) )+
scale_y_continuous( limits = c( 29.6 , 29.8 ) , expand = c( 0 , 0 ) )
require( gridExtra )
grid.arrange( p1 , p2 , nrow = 1 )
关于r - 如何获取经纬度范围内的 map ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17843580/