首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R中的Google Earth引擎和rgee包中的图像统计?

R中的Google Earth引擎和rgee包中的图像统计?
EN

Stack Overflow用户
提问于 2021-04-05 03:48:00
回答 1查看 104关注 0票数 0

我正在尝试计算Google Earth Engine中图像在县级别的所有像素的平均值,并使用R Studio中的rgee包。

我尝试了下面的例子:https://github.com/csaybar/rgee/blob/examples/image/image_stats_by_band.R

代码会运行,但会导致功能$geometry$coordinates、功能$properties等的R长打印输出,而我只想要波段的平均值,并希望在后续计算中使用该平均值。我想我想要打印的最后一行中的一个值:$features[1]$properties$data

代码语言:javascript
复制
#GY16 is an image covering a U.S. state with 1 band and I would like to calculate the mean of that image at the county level. shp1 is the county geometry.  

geometry <- shp1
means <- GY16$reduceRegions(
  collection = geometry,
  reducer = ee$Reducer$mean()$forEachBand(GY16),
  scale=10
)

print(means$getInfo())

任何建议都是值得感谢的。谢谢!

EN

回答 1

Stack Overflow用户

发布于 2021-04-05 17:52:15

此示例是在rgee早期版本中创建的,现在您可以使用ee_extract:

代码语言:javascript
复制
library(rgee)

# remotes::install_github("r-spatial/rgee") please install rgee v1.0.9
ee_Initialize()

image <- ee$Image("USDA/NAIP/DOQQ/m_3712213_sw_10_1_20140613")
geometry <- image$geometry()
ee_extract(image, geometry, scale = 100, sf = FALSE)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66945269

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档