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

\item{bbox}{Numeric vector of length four containing the bounding box
(xmin, ymin, xmax, ymax) in georeferenced coordinates.}
}
\value{
Numeric vector of length six containing the geotransform
coefficients.
}
\description{
\code{gt_from_dim_bbox()} computes geotransform coefficients from raster
dimensions and a bounding box. The resulting geotransform will always be
north-up (no rotation).
}
\examples{
# 1-degree global grid
(gt <- gt_from_dim_bbox(c(360, 180), c(-180, -90, 180, 90)))

# verify round-trip
bbox_from_dim_gt(c(360, 180), gt)
}
\seealso{
\code{\link[=GDALRaster]{GDALRaster$getGeoTransform()}},
\code{\link[=GDALRaster]{GDALRaster$setGeoTransform()}},
\code{\link[=GDALRaster]{GDALRaster$setBbox()}}, \code{\link[=bbox_from_dim_gt]{bbox_from_dim_gt()}},
\code{\link[=inv_geotransform]{inv_geotransform()}}
}
