我完全困惑,我试图创建一个区域时间序列的JRC MonthlyHistory地表水计数观测(按区域)使用R+远程。我可以下载波段的全部观测数据,但我无法通过特定的值进行过滤,在我的例子中,我想选择每个区域每月的“地表水观测”的计数。我认为这可能与数据集有关,数据集是位掩码,
位数0-1:水检测0:无数据1:非水2:水
library(rgee)
library(mapview)
ee_Initialize()
surface_water <- ee$ImageCollection("JRC/GSW1_2/MonthlyHistory")$
filterDate("2006-01-01", "2006-12-31")$
map(function(x) x$reproject("EPSG:4326")$select("water[1]"))
ee_sw <- ee_extract(x = surface_water, y = wnf_shapes, scale = 30, fun = ee$Reducer$count(), sf = FALSE)
colnames(ee_sw) <- sprintf("%02d", 1:12)
ee_sw$id <- wnf_shapes$id链接到形状文件- https://drive.google.com/file/d/1oWJ_ZpEQ4bEYr7R73oOXrQc9UhOH_oCB/view?usp=sharing
发布于 2020-11-10 15:15:58
这一守则应适用于:
library(rgee)
ee_Initialize()
geom_nauta <- ee$Geometry$Point(c(-73.47693, -4.44500))$buffer(10000)
surface_water <- ee$ImageCollection("JRC/GSW1_2/MonthlyHistory") %>%
ee$ImageCollection$filterDate("2006-01-01", "2006-12-31") %>%
ee$ImageCollection$map(function(img) img$updateMask(img$eq(1)))
ee_sw <- ee_extract(
x = surface_water,
y = geom_nauta,
scale = 30,
fun = ee$Reducer$count(),
sf = FALSE
)
plot(ee_sw %>% as.numeric(), type="l")https://stackoverflow.com/questions/64700967
复制相似问题