Learn R Programming

RGISTools (version 0.9.7)

lsPreview: Preview Landsat-7 or Landsat-8 satellite images

Description

lsPreview shows a preview of the n-th image from a set of search results.

Usage

lsPreview(searchres, n, size = NULL)

Arguments

searchres

a data.frame with the results from ls7Search or ls8Search.

n

a numeric argument identifying the location of the image in searchres.

size

a numeric argument specifying the size of the preview to be displayed, in pixels.

Details

The function shows a preview of the n-th output image from a search in the Landsat archives (ls7Search or ls8Search), with browseAvailable = "Y"). The preview is downloaded from USGS Bulk Metadata Service. Please, be aware that only some images may have a preview.

Examples

Run this code
# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
src <- paste0(tempdir(),"/Path_for_downloading_folder")
# retrieve jpg images covering Navarre between 2011 and 2013
search.res <- ls7Search(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 = src)
lsPreview(search.res, 1)
# filter the images with less than 1% pixels covered by clouds
search_cloudFree = subset(search.res, search.res$cloudCover < 1)
lsPreview(search_cloudFree, 1)
lsPreview(search_cloudFree, 2)
# }

Run the code above in your browser using DataLab