% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grid_helpers.R
\name{bbox_from_dim_gt}
\alias{bbox_from_dim_gt}
\title{Bounding box from dimensions and geotransform}
\usage{
bbox_from_dim_gt(dm, gt)
}
\arguments{
\item{dm}{Integer vector of length two containing the raster dimensions
(xsize, ysize) in pixels.}

\item{gt}{Numeric vector of length six containing the geotransform
coefficients.}
}
\value{
Numeric vector of length four containing the bounding box
(xmin, ymin, xmax, ymax) in georeferenced coordinates.
}
\description{
\code{bbox_from_dim_gt()} computes the bounding box from raster dimensions and
geotransform coefficients. For rotated rasters, returns the axis-aligned
envelope of the four corner coordinates.
}
\examples{
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
ds <- new(GDALRaster, elev_file)
gt <- ds$getGeoTransform()
dm <- ds$dim()

# should match ds$bbox()
bbox_from_dim_gt(dm, gt)
ds$bbox()

ds$close()
}
\seealso{
\code{\link[=GDALRaster]{GDALRaster$getGeoTransform()}},
\code{\link[=GDALRaster]{GDALRaster$bbox()}}, \code{\link[=gt_from_dim_bbox]{gt_from_dim_bbox()}},
\code{\link[=inv_geotransform]{inv_geotransform()}}
}
