bbox_transform()
is a convenience function for:
Arguments
- bbox
Numeric vector of length four containing a bounding box (xmin, ymin, xmax, ymax) to transform.
- srs_from
Character string in OGC WKT format specifying the spatial reference system for
bbox
.- srs_to
Character string in OGC WKT format specifying the target spatial reference system.
Examples
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
ds <- new(GDALRaster, elev_file)
ds$bbox()
#> [1] 323476.1 5101872.0 327766.1 5105082.0
bbox_transform(ds$bbox(), ds$getProjection(), epsg_to_wkt(4326))
#> [1] -113.28289 46.04764 -113.22629 46.07760
ds$close()