sf_boxes: sf boxes

Description Usage Arguments Examples

View source: R/sfc.R

Description

returns the bounding box of each geometry

Usage

1
sf_boxes(obj)

Arguments

obj

sf, sfc or sfg object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
df <- data.frame(
 id1 = c(1,1,1,1,1,1,1,1,2,2,2,2)
 , id2 = c(1,1,1,1,2,2,2,2,1,1,1,1)
 , x = c(0,0,1,1,1,1,2,2,3,4,4,3)
 , y = c(0,1,1,0,1,2,2,1,3,3,4,4)
)

sf_line <- sfheaders::sf_linestring(
  obj = df
  , x = "x"
  , y = "y"
  , linestring_id = "id1"
)

sf_boxes( sf_line )

sfheaders documentation built on Dec. 1, 2020, 1:07 a.m.