extractR: Extracts pixel values from Landsat imagery

Description Usage Arguments Value Author(s) Examples

View source: R/extractR.R

Description

This function must be run only after jpegR and visual QA of jpegs has been completed. It will extract either the pixel value or mean pixel values based on a point or polygon shape file respectively, from a stack of Landsat imagery. It can also extract some predefined vegetation indices (VI). This function:

  1. copies individual site shape files to respective QA jpeg folders

  2. obtains the dates of the remaining jpegs found in each of the QA jpeg folders

  3. uses the dates obtained from step 2 to extract data (pixel values or VI) from the local USGS Landsat archive

  4. writes the results of step 3 to a csv file within each QA jpeg folder

  5. combines all individual site data extract csv files and writes to one csv file at the working directory level

Usage

1
extractR(wkdir, imdir, shp, shp.ID, option)

Arguments

wkdir

character string of the working directory where your original shape file is located

imdir

character string of the directory where imagery is located to path/row level

shp

character string of the name of the shape file (no extension)

shp.ID

character string of the name of the field in the attribute table of the shape file that contains the unique entries (e.g.site numbers)

option

character string choice for extracted values. One of "i35", "ndvi", "b1", "b2", "b3", "b4", "b5", "b6"

Value

The csv from step 5 will contain all extracted data (pixel values or VI) for each site. An 'NA' in the data indicates that a site was impacted by cloud or fell within a missing data stripe (Landsat 7 post 2003).

Author(s)

Bart Huntley, bart.huntley@dpaw.wa.gov.au

Examples

1
2
3
4
## Not run: 
extractR("../wkdir", "../imdir", "plot_locations", "Plot_ID", "i35")

## End(Not run)

Bartesto/BARTpkg documentation built on May 5, 2019, 10:28 a.m.