amit haldar
amit haldar

Reputation: 129

Extracting sds from MODIS LAI/FPAR hdf format using gdalUtils library

I am trying to extract all layers of the MODIS LAI/FPAR imageries using gdalUTILs library, I am getting this error, could anyone help me out of this I am trying to use

Get a list of SDS names

sds <- get_subdatasets('MOD15A2H.A2016289.h28v08.006.2016302012314.hdf')

Isolate the name of the first SDS

name <- sds[1]`enter code here`
filename <- 'name/of/output/file.tif'
gdal_translate(sds[1], dst_dataset = filename)

Load the Geotiff created into R

r <- raster(filename)

and the error is

> sds <- get_subdatasets('MOD15A2H.A2016289.h28v08.006.2016302012314.hdf')

Error in split1[[1]] : subscript out of bounds In addition: Warning message: running command '"C:\Program Files (x86)\Boundless\OpenGeo\bin\gdalinfo.exe" "MOD15A2H.A2016289.h28v08.006.2016302012314.hdf"' had a status 1

Upvotes: 1

Views: 589

Answers (1)

Dheeraj
Dheeraj

Reputation: 11

Check the hdf file size. If it's 1 or 2kb then its html error file. I had same issue for MOD15A2H product.

Upvotes: 1

Related Questions