Read a landsat data file, producing an object of
The actual reading is done with readTIFF in the
tiff package, so that package must be installed for
read.landsat to work.
A connection or a character string giving the name of the file to load. This is a directory name containing the data.
The bands to be read, by default all of the bands. Use 'band=NULL' to skip the reading of bands, instead reading only the image metadata, which is often enough to check if the image is of interest in a given study. See ‘Details’ for the names of the bands, some of which are pseudo-bands, computed from the actual data.
Value of the emissivity of the surface, stored as
optional positive integer indicating the degree to which
the data should be subsampled after reading and before storage. Setting
this to 10 can speed up reading by a factor of 3 or more, but higher values
have diminishing effect. In exploratory work, it is useful to set
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.
Landsat data are provided in directories that contain TIFF files and header
read.landsat relies on a strict convention for the
names of the files in those directories. Those file names were found by
inspection of some data, on the assumption that similar patterns will hold for
other datasets for any given satellite. This is a brittle approach and it
should be born in mind if
read.landsat fails for a given dataset.
For Landsat 8, there are 11 bands, 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),
"tirs2" (band 11).
In addition to the above, setting
band="terralook" may be used as
an abbreviation for
band=c("red", "green", "nir").
For Landsat 7, there 8 bands, with names
"blue" (band 1),
"red" (band 3),
"nir" (band 4),
"tir1" (band 6A),
"tir2" (band 6B),
"swir2" (band 7)
"panchromatic" (band 8).
For Landsat 4 and 5, the bands similar to Landsat 7 but without
"panchromatic" (band 8).
An object of
landsat-class, with the conventional Oce
metadata is mainly intended for use by Oce functions, but for generality
it also contains an entry named
header that represents the full image
header in a list (with names made lower-case). The
data slot holds
matrices of the data in the requested bands, and users may add extra matrices
if desired, e.g. to store calculated quantities.
Landsat data files (directories, really) are large, accounting for
approximately 1 gigabyte each. The storage of the Oce object is
landsat-class). In R, many operations involving
copying data, so that dealing with full-scale landsat images can overwhelm
computers with storage under 8GB. For this reason, it is typical to read just
the bands that are of interest. It is also helpful to use
landsatTrim to trim the data to a geographical range, or
decimate to get a coarse view of the domain, especially
early in an analysis.
1. Konda, M. Imasato N., Nishi, K., and T. Toda, 1994. Measurement of the Sea Surface Emissivity. Journal of Oceanography, 50, 17:30. Available at http://www.terrapub.co.jp/journals/JO/pdf/5001/50010017.pdf as of February 2015.
landsat-class for more information on
especially band information. Use
landsatTrim to trim Landsat
objects geographically and
landsatAdd to add new “bands.” The
accessor operator (
[[) is used to access band information, full or
decimated, and to access certain derived quantities. A sample dataset named
landsat is provided by the oce package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.