Learn R Programming

sf (version 0.5-5)

st_bbox: Return bounding of a simple feature or simple feature set

Description

Return bounding of a simple feature or simple feature set

Usage

NA_bbox_

st_bbox(obj)

\method{st_bbox}{POINT}(obj)

\method{st_bbox}{MULTIPOINT}(obj)

\method{st_bbox}{LINESTRING}(obj)

\method{st_bbox}{POLYGON}(obj)

\method{st_bbox}{MULTILINESTRING}(obj)

\method{st_bbox}{MULTIPOLYGON}(obj)

\method{st_bbox}{GEOMETRYCOLLECTION}(obj)

\method{st_bbox}{MULTISURFACE}(obj)

\method{st_bbox}{MULTICURVE}(obj)

\method{st_bbox}{CURVEPOLYGON}(obj)

\method{st_bbox}{COMPOUNDCURVE}(obj)

\method{st_bbox}{POLYHEDRALSURFACE}(obj)

\method{st_bbox}{TIN}(obj)

\method{st_bbox}{TRIANGLE}(obj)

\method{st_bbox}{CIRCULARSTRING}(obj)

\method{st_bbox}{sfc}(obj)

\method{st_bbox}{sf}(obj)

Arguments

obj

object to compute the bounding box from

Value

a numeric vector of length four, with xmin, ymin, xmax and ymax values; if obj is of class sf, sfc, Spatial or Raster, the object returned has a class bbox, an attribute crs and a method to print the bbox and an st_crs method to retrieve the coordinate reference system corresponding to obj (and hence the bounding box). st_as_sfc has a methods for bbox objects to generate a polygon around the four bounding box points.

Format

An object of class bbox of length 4.

Details

NA_bbox_ is the bbox object with a missing value.

Examples

Run this code
# NOT RUN {
a = st_sf(a = 1:2, geom = st_sfc(st_point(0:1), st_point(1:2)), crs = 4326)
st_bbox(a)
st_as_sfc(st_bbox(a))
# }

Run the code above in your browser using DataLab