【发布时间】:2021-10-19 18:12:40
【问题描述】:
我只想为x 栅格中的“目标”类别绘制栅格计数 (l),而不考虑 NA 值。我尝试这样做:
# Packages
library(stars)
library(sf)
#Vectorizing a raster object to an sf object
tif = system.file("tif/L7_ETMs.tif", package = "stars")
x = read_stars(tif)[, 1:50, 1:50, 1:2]
x[[1]] = round(x[[1]]/5)
x[[1]] = ifelse(x[[1]]<10,NA,"target")
str(x[[1]])
#Polygonizing
l = st_contour(x)
plot(l[1])
Error in CPL_write_gdal(mat, file, driver, options, type, dims, from, :
Not compatible with requested type: [type=character; target=double].
但是,不起作用。请问有什么帮助吗?
提前致谢,
亚历山大
【问题讨论】: