Learn R Programming

gdalraster (version 1.11.1)

bbox_to_wkt: Convert a bounding box to POLYGON in OGC WKT format

Description

bbox_to_wkt() returns a WKT POLYGON string for the given bounding box. Requires GDAL built with the GEOS library.

Usage

bbox_to_wkt(bbox, extend_x = 0, extend_y = 0)

Value

Character string for an OGC WKT polygon. NA is returned if GDAL was built without the GEOS library.

Arguments

bbox

Numeric vector of length four containing xmin, ymin, xmax, ymax.

extend_x

Numeric scalar. Distance in units of bbox to extend the rectangle in both directions along the x-axis (results in xmin = bbox[1] - extend_x, xmax = bbox[3] + extend_x).

extend_y

Numeric scalar. Distance in units of bbox to extend the rectangle in both directions along the y-axis (results in ymin = bbox[2] - extend_y, ymax = bbox[4] + extend_y).

See Also

bbox_from_wkt(), g_buffer()

Examples

Run this code
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
ds <- new(GDALRaster, elev_file, read_only=TRUE)
bbox_to_wkt(ds$bbox())
ds$close()

Run the code above in your browser using DataLab