vapour_read_raster_raw: type safe(r) raster read

View source: R/raster-input.R

vapour_read_raster_rawR Documentation

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
)

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.

Value

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

Examples

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))

vapour documentation built on June 22, 2024, 10:01 a.m.