The geo_rect() type is useful as an efficient representation of rectangles stored using column vectors. Note that if any of xmin, ymin, xmax, or ymax are missing the rectangle is interpreted as an empty polygon, whereas geo_rect(NA, NA, NA, NA, srid = NA) is "missing" (see geo_is_missing() and geo_is_empty()). Infinite values (Inf and -Inf) can be used.

geo_rect(
  xmin = double(),
  ymin = double(),
  xmax = double(),
  ymax = double(),
  srid = NA
)

Arguments

xmin, ymin, xmax, ymax

Border values, recycled to a common length using vctrs::vec_recycle_common().

srid

A spatial reference identifier, coerced to an integer by as_geo_srid(). These identifiers can and should be managed outside of geovctrs except for 0, which is interpreted as "not set".

Value

A new_geovctrs_rect()

Examples

plot(geo_rect(xmin = 0:5, ymin = 0:5, xmax = 2:7, ymax = 2:7))