我有一个50米分辨率的光栅。我正试着跑到30米。我试过使用raster::disaggregate函数,但是分辨率没有改变到30米。
library(raster)
a = raster("file.tif")
b = disaggregate(a, fact=30/50, method='bilinear')如果你有其他的解决方案,这将是非常有帮助的。提前谢谢。
发布于 2021-10-11 20:48:43
fact参数需要一个整数作为disaggregate函数。您可以改用resample函数。我使用了一些样本数据,因为我没有您的数据,所以您需要根据您的环境对其进行修改。我正在对40 x 40到5 x 5进行重采样,以使绘图显示出不同之处。
library(raster)
rr <- raster(system.file("external/test.grd", package="raster"))
res(rr) # 40 by 40
#[1] 40 40
# Create a raster to aim for - make sure its projection is the same as the original and
# uses metres.
proj4string(rr)
#[1] "+proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +datum=WGS84 +units=m +no_defs"
ss <- raster(resolution=c(5,5), crs=proj4string(rr), ext=extent(rr))
res(ss) # 5 by 5
#[1] 5 5
rs <- resample(rr, ss) # This makes a new raster with the 5 by 5 resolution
res(rs) # should be 5 by 5
#[1] 5 540米乘40米...

5m x 5m...

https://stackoverflow.com/questions/69532016
复制相似问题