Learn R Programming

vapour (version 0.10.0)

vapour_read_raster_raw: type safe(r) raster read

Description

These wrappers around vapour_read_raster() guarantee single vector output of the nominated type.

Usage

vapour_read_raster_raw(
  x,
  band = 1,
  window,
  resample = "nearestneighbour",
  ...,
  sds = NULL,
  native = FALSE,
  set_na = TRUE,
  nara = FALSE
)

vapour_read_raster_int( x, band = 1, window, resample = "nearestneighbour", ..., sds = NULL, native = FALSE, set_na = TRUE )

vapour_read_raster_dbl( x, band = 1, window, resample = "nearestneighbour", ..., sds = NULL, native = FALSE, set_na = TRUE )

vapour_read_raster_chr( x, band = 1, window, resample = "nearestneighbour", ..., sds = NULL, native = FALSE, set_na = TRUE )

vapour_read_raster_hex( x, band = 1, window, resample = "nearestneighbour", ..., sds = NULL, native = FALSE, set_na = TRUE )

Value

atomic vector of the nominated type raw, int, dbl, or character (hex)

Arguments

x

data source

band

index of which band to read (1-based)

window

src_offset, src_dim, out_dim

resample

resampling method used (see details)

...

reserved

sds

index of subdataset to read (usually 1)

native

apply the full native window for read, FALSE by default

set_na

specify whether NA values should be set for the NODATA

nara

logical whether to return a (scaled) nativeRaster

Details

*_hex and *_chr are aliases of each other.

Examples

Run this code
f <- system.file("extdata", "sst.tif", package = "vapour")
vapour_read_raster_int(f, window = c(0, 0, 5, 4))
vapour_read_raster_raw(f, window = c(0, 0, 5, 4))
vapour_read_raster_chr(f, window = c(0, 0, 5, 4))
plot(vapour_read_raster_dbl(f, native = TRUE), pch = ".", ylim = c(273, 300))

Run the code above in your browser using DataLab