We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第6章 数据案例之背景地图
demo("eqMaps", package = "MSG")
其实是如下一段代码
library(RgoogleMaps) data(eq2010, package = "MSG") boundingbox = qbbox(lon = eq2010[, "long"], lat = eq2010[, "lat"]) EQMap = GetMap.bbox(boundingbox$lonR, boundingbox$latR, destfile = "EQ.png", maptype = "satellite", zoom = 6) PlotOnStaticMap(EQMap, lon = eq2010$long, lat = eq2010$lat, pch = 20, col = "red", verbose = 0 ) bgcol = rgb(255, 0, 0, alpha = 95, maxColorValue = 255) PlotOnStaticMap(EQMap, lon = eq2010$lon, lat = eq2010$lat, pch = 21, bg = bgcol, col = "darkred", cex = 1.25 * eq2010$ms, verbose = 0 )
默认情形下,地图是基于 OSM 的,即 OpenStreetMap,Google Map 的卫星图像出不来 @pzhaonet @yihui 你们在国外 Google Map 应该用起来很方便,不妨抽空查找下原因
下面是目前代码执行后输出的结果
The text was updated successfully, but these errors were encountered:
凡是涉及谷歌地图的服务,都应该去掉,国内大部分人都无法使用的,应该用 leaflet/mapbox 代替
Sorry, something went wrong.
可以。
突然想到卫星地图可以用地形海拔数据替换,举个栗子
library(sp) library(raster) # CMR 喀麦隆及其周边地区地图 cmr_map <- getData('GADM', country='CMR', level = 1) # 省界 # getData('ISO3') # 国家代码 cmr_alt <- getData('alt', country='CMR', mask=TRUE) # alt 是 altitude (海拔)的缩写 函数返回 raster 类型数据对象 png(filename = "cameroon-elevation.png", width = 1200, height = 1000, res = 200, type = "cairo") par(mar = c(4, 4, 0.5, 2)) plot(cmr_alt, xlab = "LONGITUDE", ylab = "LATITUDE") plot(cmr_map, add = TRUE, border = "gray") dev.off()
最后填上数据点
No branches or pull requests
第6章 数据案例之背景地图
其实是如下一段代码
默认情形下,地图是基于 OSM 的,即 OpenStreetMap,Google Map 的卫星图像出不来 @pzhaonet @yihui 你们在国外 Google Map 应该用起来很方便,不妨抽空查找下原因
下面是目前代码执行后输出的结果
The text was updated successfully, but these errors were encountered: