[英]how to overlay the cernatin point value in levelplot using R?
我有柵格(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=28.80046, 28.80381, 28.81314, 28.81314, 28.81144
lon=83.49621, 83.49524, 83.49450, 83.49450, 83.49201
制作一個空間點數據框;
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)
並使用“ sp.points”將其添加到rasterVis圖中
levelplot(yourRas) +
layer(sp.points(df, size=3))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.