Returns, for each polygon feature, the longitude/latitude box that
contains its edges as A5 draws them: great circles between consecutive
vertices (see a5_polygon_to_cells()). Such an edge bows toward the pole,
so the box can extend beyond the latitudes of the vertices, which a plain
vertex bounding box would miss. A ring that winds around a pole extends
the box to that pole across all longitudes.
Arguments
- x
A polygon-like geometry. One of:
Any geometry handleable by
wk::wk_handle()(e.g.wk::wkt(),wk::wkb(),wk::rct(),sf,sfc) containing one or morePOLYGON/MULTIPOLYGONfeatures.A
SpatVectorof polygons (requires theterrapackage).A two-column numeric matrix (
cbind(lon, lat)) of vertices, interpreted as a single outer ring.A
data.framewith columnslonandlat, interpreted as a single outer ring.
Value
A wk::rct() vector with one box per feature (one for matrix and
data.frame input), in WGS 84 longitude and latitude. NA for a
missing or empty geometry.
Details
Longitudes are continuous: a box crossing the antimeridian has xmin
between -180 and 180 and xmax above 180.
