
Read a window from a GDAL source as a garry-oriented matrix.
gdal_read_window.RdReturns the window with row 1 = northernmost. Offsets are 0-based
pixel coordinates. If nodata is supplied, matching cells (and any
file-level NA) are rewritten to NaN and the result is numeric.
Arguments
- path
Path or VSI URL readable by GDAL.
- band
1-based band index, or a vector of them for a multi-band read in one pass.
- x_off, y_off, x_size, y_size
0-based pixel window.
- nodata
Length-0 or length-1 sentinel to promote to NaN.
- open_options
GDAL open options ("KEY=VALUE").
- out
Output form:
"matrix"(default) returns an R numeric result;"raw_f32"returns the pixels packed as a raw row-major f32 payload, avoiding a numeric copy when the result feeds a binary store or another process.- scale, offset
Length-0 (absent) or length-1 band affine: values become
v * scale + offsetafter the nodata sentinel is promoted to NaN, so sentinels never scale.