% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tbl.R
\name{tbl_tiff}
\alias{tbl_tiff}
\title{Create a lazy table reference from a GeoTIFF raster}
\usage{
tbl_tiff(path, batch_size = .TIFF_BATCH_SIZE)
}
\arguments{
\item{path}{Path to a GeoTIFF file.}

\item{batch_size}{Number of raster rows per batch (default 256).}
}
\value{
A \code{vectra_node} object representing a lazy scan of the raster.
}
\description{
Opens a GeoTIFF file and returns a lazy query node. Each pixel becomes a row
with columns \code{x}, \code{y}, \code{band1}, \code{band2}, etc. Coordinates are pixel centers
derived from the affine geotransform. NoData values become \code{NA}.
}
\details{
Use \code{filter(x >= ..., y <= ...)} for extent-based cropping and
\code{filter(band1 > ...)} for value-based cropping. Results can be converted
back to a raster with \code{terra::rast(df, type = "xyz")}.
}
\examples{
\donttest{
f <- tempfile(fileext = ".tif")
df <- data.frame(x = as.double(rep(1:4, 3)),
                 y = as.double(rep(1:3, each = 4)),
                 band1 = as.double(1:12))
write_tiff(df, f)
node <- tbl_tiff(f)
node |> filter(band1 > 6) |> collect()
unlink(f)
}

}
