[R-sig-Geo] readGDAL no bands in dataset MOD16A2 hdf4

angelini75 angelini75 at gmail.com
Thu Mar 5 10:50:32 CET 2015


Hi,

I'm trying to process MODIS product MOD16A2 (Potential Evapotranspiration).
I need to process 180 images like this:
ftp://ftp.ntsg.umt.edu/pub/MODIS/NTSG_Products/MOD16/MOD16A2_MONTHLY.MERRA_GMAO_1kmALB/Y2014/M12/MOD16A2.A2007M06.h12v13.105.2013120050055.hdf

I downloaded the files at my working directory but I have problem to reed it
with RGDAL

readGDAL("output/h12v12/h12v12_A2000M01.hdf")
output/h12v12/h12v12_A2000M01.hdf has GDAL driver HDF4 
and has 512 rows and 512 columns
Error in getRasterData(x, band = band, offset = offset, region.dim =
region.dim,  : 
  no bands in dataset
In addition: Warning messages:
1: In dim(x) : no bands in dataset
2: In dim(x) : no bands in dataset
3: In readGDAL("output/h12v12/h12v12_A2000M01.hdf") :
  GeoTransform values not available 

When I open the file in QGIS, I can see this
MOD_Grid_MOD16A2:ET_1km
MOD_Grid_MOD16A2:LE_1km
MOD_Grid_MOD16A2:PET_1km
MOD_Grid_MOD16A2:PLE_1km

I have followed this script, which works well for MOD13Q1
(https://everydropr.wordpress.com/2011/11/06/how-to-processing-hdf4-data-using-r/),
but it does not with MOD16A2
 hdfImage <- readGDAL(paste("HDF4_EOS:EOS_GRID:", files[1],
":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days EVI", sep = ""))
 image(hdfImage)
 writeGDAL(hdfImage, "/Users/name/Documents/R_HDF4/output/hdfImage.tif",
drivername = "GTiff", type = "Float32", mvFlag = NA, options=NULL,
copy_drivername = "GTiff", setStatistics=FALSE) 

Thanks in advance for the help.
Marcos






--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/readGDAL-no-bands-in-dataset-MOD16A2-hdf4-tp7587868.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list