% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/raster.R
\name{vec_write_raster}
\alias{vec_write_raster}
\title{Write a raster matrix or 3D array to a .vec raster file}
\usage{
vec_write_raster(
  x,
  path,
  dtype = "f32",
  tile_size = 512L,
  extent = NULL,
  gt = NULL,
  epsg = 0L,
  nodata = NA_real_,
  band_names = NULL,
  compression = c("fast", "balanced", "max")
)
}
\arguments{
\item{x}{A numeric matrix \code{c(rows, cols)} for a single band, or a numeric
3D array \code{c(rows, cols, bands)} for multi-band.}

\item{path}{Output file path.}

\item{dtype}{Storage dtype, one of \code{"f64"}, \code{"f32"}, \code{"i8"}, \code{"u8"},
\code{"i16"}, \code{"u16"}, \code{"i32"}, \code{"u32"}, \code{"i64"}, \code{"u64"}. Defaults to \code{"f32"}
for floating-point input — \code{"f64"} doubles file size with no information
gain for typical climate rasters.}

\item{tile_size}{Square tile edge in pixels. Default 512.}

\item{extent}{Numeric vector \code{c(xmin, ymin, xmax, ymax)}. Used together with
the raster dimensions to derive the geotransform. Either \code{extent} or
\code{gt} must be supplied for georeferenced output.}

\item{gt}{Numeric(6) GDAL-style geotransform. Overrides \code{extent} if both
are given.}

\item{epsg}{EPSG code (integer) or 0L for none.}

\item{nodata}{Nodata value, or \code{NA_real_} to skip recording one.}

\item{band_names}{Optional character vector of length equal to the number
of bands.}

\item{compression}{Compression effort, one of \code{"fast"} (single spec, fast
encode), \code{"balanced"} (probe two entropy coders, ~2x encode time), or
\code{"max"} (probe six candidate specs per tile, slowest encode but
smallest file). Decode cost is unchanged across levels because each
tile records its own codec spec. Default \code{"fast"}.}
}
\value{
Invisible \code{NULL}.
}
\description{
Writes a row-major raster (one band) or a band-major 3D array (multi-band)
to the VECR raster format. Each tile is encoded as a self-describing tdc
block (PRED_2D + BYTE_SHUFFLE + LZ).
}
