如何从多个Rasterbrick文件在R中生成hdf5?通常,数据是以hdf5格式提供的,为了便于处理,必须将其转换为更友好的格式。
目前我知道rhdf5 package,但是如何获得RasterBrick是我不确定的。
source("http://bioconductor.org/biocLite.R")
biocLite("rhdf5")
library("rhdf5")
library("raster")您可以在此链接hdf5上访问多个THRESHOLD=4000000文件。
您可以使用两个文件进行说明。
谢谢!
在…。
发布于 2016-02-19 19:11:42
一种选择是使用gdalUtils将hdf5文件转换为GTiff。一旦你这样做了,你就可以在一个堆栈中读取它们。下面是一个示例代码:
# list all the `hdf5` files
files <- list.files(path=".", pattern=paste(".*.h5",sep=""), all.files=FALSE, full.names=TRUE)
#choose the band that you want using the sds[] option and write GTiff files.
for (i in (files)) {
sds <- get_subdatasets(i)
r2 <- gdal_translate(sds[1], dst_dataset =paste(i,".tif",sep=""))}https://stackoverflow.com/questions/35323495
复制相似问题