s2_bounds_cap: Compute feature-wise and aggregate bounds

View source: R/s2-bounds.R

s2_bounds_capR Documentation

Compute feature-wise and aggregate bounds

Description

s2_bounds_rect() returns a bounding latitude-longitude rectangle that contains the region; s2_bounds_cap() returns a bounding circle represented by a centre point (lat, lng) and an angle. The bound may not be tight for points, polylines and geometry collections. The rectangle returned may depend on the order of points or polylines. lng_lo values larger than lng_hi indicate regions that span the antimeridian, see the Fiji example.

Usage

s2_bounds_cap(x)

s2_bounds_rect(x)

Arguments

x

An s2_geography() vector.

Value

Both functions return a data.frame:

  • s2_bounds_rect(): Columns minlng, minlat, maxlng, maxlat (degrees)

  • s2_bounds_cap(): Columns lng, lat, angle (degrees)

Examples

s2_bounds_cap(s2_data_countries("Antarctica"))
s2_bounds_cap(s2_data_countries("Netherlands"))
s2_bounds_cap(s2_data_countries("Fiji"))

s2_bounds_rect(s2_data_countries("Antarctica"))
s2_bounds_rect(s2_data_countries("Netherlands"))
s2_bounds_rect(s2_data_countries("Fiji"))


s2 documentation built on May 31, 2023, 9:33 p.m.