简体   繁体   English

将曲线添加到栅格地图?

[英]Add curves to raster map?

would it be possible to add isoclines or something like "filled.contour" to a raster map? 是否可以向栅格地图添加等高线或类似“ filled.contour”的东西?

Eg to a Bioclim variable? 例如,要使用Bioclim变量? (RasterLayer) (RasterLayer)

# Download Bioclim data 
library(dismo)
tmin_06<-getData("worldclim", var="tmin", res=0.5, lon=10, lat=70)
# plot tmin 
plot(tmin$tmin1_06)

And then add e.g. filled.contour {graphics}

I can't seem to extract the correct values from the RasterLayer and get an error massage: "cannot coerce type 'S4' to vector of type 'double'" 我似乎无法从RasterLayer提取正确的值并得到错误消息:“无法将类型'S4'强制转换为类型'double'的向量”

Or what would you use to illustrate the direction of change in a map like this for temperature, or for equidistance in an elevation map? 或者,您将用什么来说明像这样的温度或高程图等距图中的变化方向?

Thank you! 谢谢!

Daniel 丹尼尔

Here are two approaches: 这是两种方法:

# example data
f <- system.file("external/test.grd", package="raster")
r <- raster(f)

plot(r)
contour(r, add=TRUE)

# or
filledContour(r)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM