geo_bbox: Bounding boxes and envelopes

Description Usage Arguments Value Examples

View source: R/geo-bbox.R

Description

Whereas a geo_bbox() of a geovctr is always of length 1, a geo_envelope() shares the same length as the vector. Both return a geo_rect(). Empty vectors (and empty geometries) return geo_rect(Inf, Inf, -Inf, -Inf), and NA/NaN values are removed if na.rm = TRUE (which might mean more Inf values than you expected).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
geo_bbox(x, ..., na.rm = FALSE, finite = FALSE)

geo_x_range(x, ..., na.rm = FALSE, finite = FALSE)

geo_y_range(x, ..., na.rm = FALSE, finite = FALSE)

geo_envelope(x, ..., na.rm = FALSE, finite = FALSE)

geo_x_envelope(x, ..., na.rm = FALSE, finite = FALSE)

geo_y_envelope(x, ..., na.rm = FALSE, finite = FALSE)

Arguments

x

A geometry-like object, or one that can be coerced to a geometry-like object using as_geovctr().

...

Unused

na.rm

Should NAs be removed?

finite

Should only finite values be considered? TRUE implies na.rm = TRUE.

Value

geo_bbox() returns a geo_rect() of length 1, geo_envelope() returns a geo_rect() with the same length as x, geo_(x|y)_range() returns a geo_lim() of length 1, and geo_(x|y)_envelope() returns a geo_lim() with the same length as x.

Examples

1
2
geo_bbox(wkt(c("POINT (30 10)", "POINT EMPTY")))
geo_envelope(wkt(c("POINT (30 10)", "POINT EMPTY")))

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.