r-stars - 带有值的星对象缺少图层
问题描述
如果我尝试使用stars::
包从内存中加载 tif 文件,则此对象中没有包含这些值的层。
这是我正在寻找的一个例子:
r <- raster::raster(ncol=10, nrow=10)
raster::values(r) <- c(1:90,1:10)
r_stars <- stars::st_as_stars(r)
r_stars
具有 2 个维度和 1 个属性的星星对象
属性):
分钟。第一曲。中位数平均第三曲。最大限度。
第 1 层 15.75 40.5 41.5 65.25 90
方面):
从到偏移 delta refsys 点值 x/y
x 1 10 -180 36 +proj=longlat +datum=WGS8... NA NULL [x]
y 1 10 90 -18 +proj=longlat +datum=WGS8... NA NULL [y]
在 r_stars 中有一个包含所有值的“层”。但是,如果我使用函数从内存中加载 tif 文件,read_stars()
则输出如下所示:
r_stars <- read_stars("data/dem/dem/1.tif")
r_stars
1 个文件中具有 1 个属性的 stars_proxy 对象:
$
1.tif
[1] "[...]/1.tif"
方面):
从到偏移 delta refsys 点值 x/y
x 1 14400 95 0.000277778 WGS 84 FALSE NULL [x]
y 1 9360 29.6001 -0.000277778 WGS 84 FALSE NULL [y]
缺少“层”。我实际上对如何使用来自星星对象的值一无所知。是否有需要在read_stars()
-function 中指定的参数?
最好的问候,斯滕
解决方案
推荐阅读
- python - 计算中的不一致 - Python & numpy
- java - 部署JAR文件后更新spring boot静态资源
- javascript - Javascript 中的有效注释
- linux - “0/1 * * * *”的时间表在kubernetes cron作业中是什么意思
- flutter - Flutter google_sign_in package 登录问题,PlatformException
- php - Wordpress - 子主题不会在新的 index.php 上加载我的 CSS
- reactjs - 错误:应用程序(...):渲染没有返回任何内容。这通常意味着缺少返回语句
- swift - 如何从 macOS 应用程序中的文件系统读取图像
- unity3d - 使用 Hololens 1 和 Optitrack Trio bar 匹配对象位置和方向
- .net-core - 没有注册类型“Polly.Registry.IReadOnlyPolicyRegistry`1[System.String]”的服务