Nor*_*ude 3 r r-raster r-sf r-stars
我是该包的新手stars,R正在尝试使用曲线数据进行基本的空间操作。我正在使用 netCDF 气候数据。我能够将 netcdf 与 shapefile 一起读入 r 中,我想用它来指定我想要进行分析的区域。我尝试直接使用裁剪文件,st_crop()但收到以下错误:
Warning message:
In st_crop.stars(test, wrst) : crop only crops regular grids
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用如下代码来扭曲星星对象:
warp <- test %>% st_set_crs(3338) %>% st_warp(st_as_stars(st_bbox(), dx = 2))
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
Error in colrow_from_xy(pts, x, NA_outside = TRUE) :
colrow_from_xy not supported for curvilinear objects
Run Code Online (Sandbox Code Playgroud)
我是否需要“展平”曲线网格才能在给定区域进行分析?如果是这样,我该怎么做?或者,相反,如果我能够进行类似st_crop()或等效的操作或使用曲线网格的raster操作,有人可以为我指出正确的方向吗?非常感谢。calc()stackApply()