bfastSpatial icon indicating copy to clipboard operation
bfastSpatial copied to clipboard

Make the package cross platform

Open loicdtx opened this issue 11 years ago • 3 comments

Main 'bottleneck' is the hdf2ndvi function and perhaps also processLandsat

loicdtx avatar Apr 08 '14 16:04 loicdtx

Proper use of tmp files is necessary if an intermediary gdal_translate.py method is to be used.

loicdtx avatar Apr 08 '14 16:04 loicdtx

#To get a single sds as a rasterLayer object sds <- get_subdatasets('/full/path/to/file.hdf') tmp <- rasterTmpFile() extension(tmp) <- 'tif' gdal_translate(sds[1], dst_dataset = tmp) # Check the ot = argument as well r <- raster(tmp)

#Check whether the first argument of gdal_translate can be a list, hence producing a multilayer raster object.

loicdtx avatar Sep 10 '14 13:09 loicdtx

nice!

On Wed, Sep 10, 2014 at 3:10 PM, Loïc Dutrieux [email protected] wrote:

To get a single sds as a rasterLayer object

sds <- get_subdatasets('/full/path/to/file.hdf') tmp <- rasterTmpFile() extension(tmp) <- 'tif' gdal_translate(sds[1], dst_dataset = tmp) # Check the ot = argument as well r <- raster(tmp)

#Check whether the first argument of gdal_translate can be a list, hence producing a multilayer raster object.

— Reply to this email directly or view it on GitHub https://github.com/dutri001/bfastSpatial/issues/14#issuecomment-55112299 .

janverbesselt avatar Sep 10 '14 13:09 janverbesselt