landsat_mask_function {rsi}R Documentation

Create a Landsat mask raster from the QA band

Description

Create a Landsat mask raster from the QA band

Usage

landsat_mask_function(raster, include = c("land", "water", "both"))

Arguments

raster

The QA band of a Landsat image

include

Include pixels that represent land, water, or both? Passing c("land", "water") is identical to passing "both".

Value

A boolean raster to be used to mask a Landsat image

Examples


aoi <- sf::st_point(c(-74.912131, 44.080410))
aoi <- sf::st_set_crs(sf::st_sfc(aoi), 4326)
aoi <- sf::st_buffer(sf::st_transform(aoi, 5070), 100)

landsat_image <- get_landsat_imagery(
  aoi,
  start_date = "2022-06-01",
  end_date = "2022-08-30",
  mask_function = landsat_mask_function
)


[Package rsi version 0.2.1 Index]