我有光栅(DEM)
class : RasterLayer
dimensions : 164, 96, 15744 (nrow, ncol, ncell)
resolution : 0.0002777778, 0.0002777778 (x, y)
extent : 83.47915, 83.50582, 28.80114, 28.84669 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : in memory
names : layer
values : -4.737531, 0.554273 (min, max)
我希望覆盖点值
p = -3.9837500 -2.6327150 -1.4857878 -1.0200000 -0.7716000
在以下lat-long
中lat=28.80046, 28.80381, 28.81314, 28.81314, 28.81144
lon=83.49621, 83.49524, 83.49450, 83.49450, 83.49201
答案 0 :(得分:1)
制作空间点数据框;
p = -3.9837500 -2.6327150 -1.4857878 -1.0200000 -0.7716000
lat=28.80046, 28.80381, 28.81314, 28.81314, 28.81144
lon=83.49621, 83.49524, 83.49450, 83.49450, 83.49201
df <- data.frame(lat = lat, lon= lon, z = p)
coordinates(df) <- ~lon+lat
crs(df) <- projection(yourRas)
使用&#39; sp.points&#39;
添加到rasterVis图levelplot(yourRas) +
layer(sp.points(df, size=3))