bbox_to_wkt() returns a WKT POLYGON string for the given bounding box.
Arguments
- bbox
Numeric vector of length four containing xmin, ymin, xmax, ymax.
- extend_x
Numeric scalar. Distance in units of
bboxto extend the rectangle in both directions along the x-axis (results inxmin = bbox[1] - extend_x,xmax = bbox[3] + extend_x).- extend_y
Numeric scalar. Distance in units of
bboxto extend the rectangle in both directions along the y-axis (results inymin = bbox[2] - extend_y,ymax = bbox[4] + extend_y).
Examples
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
ds <- new(GDALRaster, elev_file, read_only=TRUE)
bbox_to_wkt(ds$bbox())
#> [1] "POLYGON ((323476.071970863 5101871.98303138,327766.071970863 5101871.98303138,327766.071970863 5105081.98303138,323476.071970863 5105081.98303138,323476.071970863 5101871.98303138))"
ds$close()