ls8Search: Search Landsat-8 images

Description Usage Arguments Details Value Examples

View source: R/ls8Search.R

Description

ls8Search searches Landsat-8 images in the Landsat repository concerning a particular location and date interval. The function returns a data.frame with the names of the images and their metadata.

Usage

1
ls8Search(AppRoot, verbose = FALSE, precise = FALSE, ...)

Arguments

AppRoot

directory of the metadata file.

verbose

logical argument. If TRUE, the function prints the running steps and warnings.

precise

logical argument. If TRUE, conducts a thorough search, tile by tile (slower).

...

arguments for nested functions:

  • dates a vector with the capturing dates being searched. This argument is mandatory if startDate and endDate are not defined.

  • startDate a Date class object with the starting date of the study period. This argument is mandatory if dates is not defined.

  • endDate a Date class object with the ending date of the study period. This argument is mandatory if dates is not defined.

  • region a Spatial*, projected raster*, or sf class object defining the area of interest. This argument is mandatory if pathrow, extent, or lonlat are not defined.

  • pathrow a list of vectors with the path and row numbers of the tiles concerning the region of interest. This argument is mandatory if region, extent, or lonlat are not provided. Ex. list(c(200,31),c(200,30)).

  • lonlat a vector with the longitude/latitude coordinates of the point of interest. Ex. c(-1.64323,42.81687).

  • extent an extent, Raster*, or Spatial* object representing the region of interest with longitude/latitude coordinates. This argument is mandatory if region, pathrow, or lonlat are not defined.

  • column names in the .LS8MD data.frame and their values.

Details

ls8Search searches images in the metadata file. If the metadata was downloaded before to the current directory, ls8Search will use this metadata by default. In case the metadata was not downloaded yet, ls8Search will make that call for you. The function creates the following subfolders "Landsat-8/metadata", where the metadata file is located.

Landsat images are organized by tiles, which have a unique path and row numbers according to the Worldide Reference System. The fastest way to search an image in the metadata file is by path and row (pathrow). This method requires to know in advance the path and row number of the tile that is relevant for your region of interest. From the user's standpoint, the simplest way to search a time series of Landsat-7 images is by region, extent, or lonlat since they do not require any prior knowledge about tiles.

The function can screen the results by any other attribute in the metadata. For instance, to filter the imagery with an available preview, the browseAvaliable=”Y” must be added as an argument of the function (see the examples).

Value

a data.frame with the name of the images and their metadata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# search by path and row numbers of a tile
wdir <- file.path(tempdir(),"Path_for_downloading_folder")
sres <- ls8Search(startDate = as.Date("01-01-2011", "%d-%m-%Y"),
                  endDate = as.Date("31-12-2013", "%d-%m-%Y"),
                  pathrow = list(c(200, 31), c(200, 30)),
                  browseAvaliable = "Y",
                  AppRoot = wdir)

# search by extent (long/lat coordinates)
# load a spatial polygon object of Navarre
data(ex.navarre)
sres <- ls8Search(startDate = as.Date("01-01-2011", "%d-%m-%Y"),
                  endDate = as.Date("31-12-2013", "%d-%m-%Y"),
                  extent = ex.navarre,
                  precise = TRUE,
                  browseAvaliable = "Y",
                  AppRoot = wdir)

# search by extent (fast mode)
sres <- ls8Search(startDate = as.Date("01-01-2011", "%d-%m-%Y"),
                  endDate = as.Date("31-12-2013", "%d-%m-%Y"),
                  extent = ex.navarre,
                  precise = FALSE,
                  browseAvaliable = "Y",
                  AppRoot = wdir)
# remove metadata to free memory space
lsRemoveMetadata()

## End(Not run)

RGISTools documentation built on July 2, 2020, 3:58 a.m.