| bbox_from_dim_gt | R Documentation |
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.
bbox_from_dim_gt(dm, gt)
dm |
Integer vector of length two containing the raster dimensions (xsize, ysize) in pixels. |
gt |
Numeric vector of length six containing the geotransform coefficients. |
Numeric vector of length four containing the bounding box (xmin, ymin, xmax, ymax) in georeferenced coordinates.
GDALRaster$getGeoTransform(),
GDALRaster$bbox(), gt_from_dim_bbox(),
inv_geotransform()
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.