Learn R Programming

oce (version 0.9-14)

read.landsat: Read a landsat data file

Description

Read a landsat data file, producing an object of type landsat.

Usage

read.landsat(file, band=1:11, debug=getOption("oceDebug"))

Arguments

file
a connection or a character string giving the name of the file to load. This is a directory name containing the data.
band
the bands to read, by default all of the Landsat-8 bands. See Value for the names of the bands.
debug
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.

Value

  • An object of class landsat, with the conventional Oce slots metadata, data and processingLog. The data slot holds matrices of the data in the requested bands.

Details

The tiff package must be installed for this to work. The function follows a strict file naming code that works for Landsat-8 datasets but may fail otherwise. Also, it only works for detailed data (in TIF format), not for preview data (in JPG format). Landsat data are provided on several websites, e.g. [1]. Reference [2] provides information on the bands.

The bands are stored in the object with names "aerosol" (band 1), "blue" (band 2), "green" (band 3), "red" (band 4), "nir" (band 5), "swir1" (band 6), "swir2" (band 7), "panchromatic" (band 8), "cirrus" (band 9), "tirs1" (band 10), and "tirs2" (band 11). See [2] for information on these bands and their typical uses.

References

1. http://glovis.usgs.gov

2. http://landsat.gsfc.nasa.gov/?page_id=5377

See Also

See landsat-class for more information on landsat objects. A sample dataset named landsat is available in the ocedata package.