MODIS (version 1.1.7)

getSds: List SDS Layers in an .HDF File

Description

This function lists the names of all scientific datasets (SDS) contained in a specified MODIS grid HDF file.

Usage

getSds(HdfName, SDSstring = NULL, method = "gdal")

Arguments

HdfName

character. (Absolute) filename from which to extract SDS names.

SDSstring

character, see Value.

method

character, defaults to "gdal". Caution: on Windows, the default 'GDAL' installation doesn't support HDF4 files. Install 'FWTools' or use method = "mrt" instead.

Value

A list or character. If SDSstring is provided, the function reports extracted SDS and a formatted SDSsting (e.g., "11101"). If not provided, the SDS names in HdfName are returned. Consult the MRT manual for details.

Examples

Run this code
# NOT RUN {
getSds(HdfName="XXX.hdf")
getSds(HdfName="/path/XXX.hdf",method="gdal") # require GDAL (FWTools on Windows)
getSds(HdfName="/path/XXX.hdf",method="mrt") # require MRTool
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace