Reading geotifs from AWS S3 buckets using the R's aws.s3 package

时间:2019-02-24 00:24:56

标签: r amazon-s3 amazon-ec2 raster

I am using an Rstudio Server Amazon Machine Image (AMI) from http://www.louisaslett.com/RStudio_AMI/获取href。我在Amazon S3存储桶中有许多大型(〜1.4GB)压缩TIFF图像(LZW压缩)。我已经安装了aws.s3和raster软件包。当我尝试通过使用get_object()将tiff之一移入AMI时,它将作为矢量而不是geotiff导入(请参见下文)。关于如何将其作为栅格移动的任何建议将不胜感激。

> temp<-aws.s3::get_object(object="l***2.tif", bucket = 'b***b', key = 'A***Q', secret = 'k***p')

> raster(temp)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘raster’ for signature ‘"raw"’

> is.vector(temp)
[1] TRUE

> length(temp)
[1] 1532610194

> temp[1:20]
 [1] 49 49 2a 00 08 00 00 00 13 00 00 01 03 00 01 00 00 00 0d c3

0 个答案:

没有答案