
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.- decim
Optional decimating-read spec from
.rio_direct_spec()(fx/fyinteger decimation factors,x_off/y_offthe source pixel origin of the target grid,resampthe RasterIO algorithm). When supplied the window arguments are read as TARGET-grid pixels and translated to the source window internally, so a caller chunked on the target grid needs no coordinate maths of its own.