constructs an sfc of POLYGON objects

sfc_polygon(
  obj = NULL,
  x = NULL,
  y = NULL,
  z = NULL,
  m = NULL,
  polygon_id = NULL,
  linestring_id = NULL,
  close = TRUE
)

Arguments

obj

sorted matrix or data.frame

x

x geometry column

y

y geometry column

z

z geometry column

m

m geometry column

polygon_id

column of ids for polygons

linestring_id

column of ids for lines (within polygons)

close

logical indicating whether polygons should be closed. If TRUE, all polygons will be checked and force closed if possible

Value

sfc object of POLYGON geometries

notes

sfheaders functions do not perform any validity checks on the geometries. Nor do they set Coordinate Reference Systems, EPSG, PROJ4 or precision attributes.

The data.frame and matrices you send into the sfheader functions must be ordered.

Examples


m <- matrix(c(0,0,0,0,1,1), ncol = 2 )
sfc_polygon( m )
#> [[1]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> [3,]    0    1
#> [4,]    0    0
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    0    1 
#> attr(,"class")
#> [1] "bbox"

m <- matrix(c(0,0,0,0,0,1,0,1,1,1,2,2,1,2,3,1,3,2), ncol = 3, byrow = TRUE)
sfc_polygon( obj = m )
#> [[1]]
#> [[1]]
#>      [,1] [,2] [,3]
#> [1,]    0    0    0
#> [2,]    0    0    1
#> [3,]    0    1    1
#> [4,]    1    2    2
#> [5,]    1    2    3
#> [6,]    1    3    2
#> [7,]    0    0    0
#> 
#> attr(,"class")
#> [1] "XYZ"     "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    1    3 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#> zmin zmax 
#>    0    3 
#> attr(,"class")
#> [1] "z_range"
sfc_polygon( obj = m, polygon_id = 1 )
#> [[1]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> [3,]    1    1
#> [4,]    0    0
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> [[2]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    2    2
#> [2,]    2    3
#> [3,]    3    2
#> [4,]    2    2
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    3    3 
#> attr(,"class")
#> [1] "bbox"
sfc_polygon( obj = m, linestring_id = 1 )
#> [[1]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> [3,]    1    1
#> [4,]    0    0
#> 
#> [[2]]
#>      [,1] [,2]
#> [1,]    2    2
#> [2,]    2    3
#> [3,]    3    2
#> [4,]    2    2
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    3    3 
#> attr(,"class")
#> [1] "bbox"

sfc_polygon( obj = m, linestring_id = 1, polygon_id = 1 )
#> [[1]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> [3,]    1    1
#> [4,]    0    0
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> [[2]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    2    2
#> [2,]    2    3
#> [3,]    3    2
#> [4,]    2    2
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    3    3 
#> attr(,"class")
#> [1] "bbox"

sfc_polygon( obj = m, x = 2, y = 3 )
#> [[1]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> [3,]    1    1
#> [4,]    2    2
#> [5,]    2    3
#> [6,]    3    2
#> [7,]    0    0
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    3    3 
#> attr(,"class")
#> [1] "bbox"
sfc_polygon( obj = m, x = 1, y = 2, z = 3 )
#> [[1]]
#> [[1]]
#>      [,1] [,2] [,3]
#> [1,]    0    0    0
#> [2,]    0    0    1
#> [3,]    0    1    1
#> [4,]    1    2    2
#> [5,]    1    2    3
#> [6,]    1    3    2
#> [7,]    0    0    0
#> 
#> attr(,"class")
#> [1] "XYZ"     "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    1    3 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#> zmin zmax 
#>    0    3 
#> attr(,"class")
#> [1] "z_range"
sfc_polygon( obj = m, x = 2, y = 3, linestring_id = 1, polygon_id = 1 )
#> [[1]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> [3,]    1    1
#> [4,]    0    0
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> [[2]]
#> [[1]]
#>      [,1] [,2]
#> [1,]    2    2
#> [2,]    2    3
#> [3,]    3    2
#> [4,]    2    2
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#> xmin ymin xmax ymax 
#>    0    0    3    3 
#> attr(,"class")
#> [1] "bbox"

df <- data.frame(
  ml_id = c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2)
  , l_id = c(1,1,1,2,2,2,3,3,3,1,1,1,2,2,2)
  , x = rnorm(15)
  , y = rnorm(15)
  , z = rnorm(15)
  , m = rnorm(15)
)

sfc_polygon( obj = df, x = "x", y = "y")
#> [[1]]
#> [[1]]
#>              [,1]       [,2]
#>  [1,]  0.51432778 -0.8507169
#>  [2,] -1.75137511  0.5662016
#>  [3,]  0.89359752  1.1522120
#>  [4,]  0.22303837 -0.7561974
#>  [5,]  0.58081659 -0.4892583
#>  [6,] -0.17782142 -1.1660523
#>  [7,]  0.74096671 -0.4796690
#>  [8,] -0.99744308  0.1153482
#>  [9,] -2.93897756 -1.7680484
#> [10,]  0.71901566 -1.4076389
#> [11,] -0.69800504  0.7091785
#> [12,] -1.89412584 -1.2408429
#> [13,]  0.07629925 -0.3683273
#> [14,]  0.87530850  0.4620801
#> [15,]  0.45382739 -0.3228331
#> [16,]  0.51432778 -0.8507169
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#> -2.9389776 -1.7680484  0.8935975  1.1522120 
#> attr(,"class")
#> [1] "bbox"
sfc_polygon( obj = df, x = "x", y = "y", z = "z")
#> [[1]]
#> [[1]]
#>              [,1]       [,2]         [,3]
#>  [1,]  0.51432778 -0.8507169 -1.287214810
#>  [2,] -1.75137511  0.5662016 -1.030040247
#>  [3,]  0.89359752  1.1522120  1.514089316
#>  [4,]  0.22303837 -0.7561974  0.346903586
#>  [5,]  0.58081659 -0.4892583  1.779441542
#>  [6,] -0.17782142 -1.1660523  0.386630924
#>  [7,]  0.74096671 -0.4796690 -0.918695239
#>  [8,] -0.99744308  0.1153482 -1.584336488
#>  [9,] -2.93897756 -1.7680484 -0.084058892
#> [10,]  0.71901566 -1.4076389 -2.085070889
#> [11,] -0.69800504  0.7091785  0.003567992
#> [12,] -1.89412584 -1.2408429 -0.355770822
#> [13,]  0.07629925 -0.3683273  1.146359751
#> [14,]  0.87530850  0.4620801 -0.221188446
#> [15,]  0.45382739 -0.3228331  1.018179021
#> [16,]  0.51432778 -0.8507169 -1.287214810
#> 
#> attr(,"class")
#> [1] "XYZ"     "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#> -2.9389776 -1.7680484  0.8935975  1.1522120 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#>      zmin      zmax 
#> -2.085071  1.779442 
#> attr(,"class")
#> [1] "z_range"
sfc_polygon( obj = df, x = "x", y = "y", z = "z", m = "m")
#> [[1]]
#> [[1]]
#>              [,1]       [,2]         [,3]       [,4]
#>  [1,]  0.51432778 -0.8507169 -1.287214810 -0.2637193
#>  [2,] -1.75137511  0.5662016 -1.030040247  1.6585423
#>  [3,]  0.89359752  1.1522120  1.514089316 -0.7740868
#>  [4,]  0.22303837 -0.7561974  0.346903586 -0.9239379
#>  [5,]  0.58081659 -0.4892583  1.779441542 -0.2755334
#>  [6,] -0.17782142 -1.1660523  0.386630924 -0.5933997
#>  [7,]  0.74096671 -0.4796690 -0.918695239 -0.1222859
#>  [8,] -0.99744308  0.1153482 -1.584336488  1.1797842
#>  [9,] -2.93897756 -1.7680484 -0.084058892  0.6410374
#> [10,]  0.71901566 -1.4076389 -2.085070889 -0.6295885
#> [11,] -0.69800504  0.7091785  0.003567992 -0.8077350
#> [12,] -1.89412584 -1.2408429 -0.355770822 -0.8604899
#> [13,]  0.07629925 -0.3683273  1.146359751 -2.1692387
#> [14,]  0.87530850  0.4620801 -0.221188446 -1.3758365
#> [15,]  0.45382739 -0.3228331  1.018179021 -0.4931325
#> [16,]  0.51432778 -0.8507169 -1.287214810 -0.2637193
#> 
#> attr(,"class")
#> [1] "XYZM"    "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#> -2.9389776 -1.7680484  0.8935975  1.1522120 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#>      zmin      zmax 
#> -2.085071  1.779442 
#> attr(,"class")
#> [1] "z_range"
#> attr(,"m_range")
#>      mmin      mmax 
#> -2.169239  1.658542 
#> attr(,"class")
#> [1] "m_range"

sfc_polygon( obj = df, x = 2, y = 3)
#> [[1]]
#> [[1]]
#>       [,1]        [,2]
#>  [1,]    1  0.51432778
#>  [2,]    1 -1.75137511
#>  [3,]    1  0.89359752
#>  [4,]    2  0.22303837
#>  [5,]    2  0.58081659
#>  [6,]    2 -0.17782142
#>  [7,]    3  0.74096671
#>  [8,]    3 -0.99744308
#>  [9,]    3 -2.93897756
#> [10,]    1  0.71901566
#> [11,]    1 -0.69800504
#> [12,]    1 -1.89412584
#> [13,]    2  0.07629925
#> [14,]    2  0.87530850
#> [15,]    2  0.45382739
#> [16,]    1  0.51432778
#> 
#> attr(,"class")
#> [1] "XY"      "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#>  1.0000000 -2.9389776  3.0000000  0.8935975 
#> attr(,"class")
#> [1] "bbox"
sfc_polygon( obj = df, x = 2, y = 3, z = 4)
#> [[1]]
#> [[1]]
#>       [,1]        [,2]       [,3]
#>  [1,]    1  0.51432778 -0.8507169
#>  [2,]    1 -1.75137511  0.5662016
#>  [3,]    1  0.89359752  1.1522120
#>  [4,]    2  0.22303837 -0.7561974
#>  [5,]    2  0.58081659 -0.4892583
#>  [6,]    2 -0.17782142 -1.1660523
#>  [7,]    3  0.74096671 -0.4796690
#>  [8,]    3 -0.99744308  0.1153482
#>  [9,]    3 -2.93897756 -1.7680484
#> [10,]    1  0.71901566 -1.4076389
#> [11,]    1 -0.69800504  0.7091785
#> [12,]    1 -1.89412584 -1.2408429
#> [13,]    2  0.07629925 -0.3683273
#> [14,]    2  0.87530850  0.4620801
#> [15,]    2  0.45382739 -0.3228331
#> [16,]    1  0.51432778 -0.8507169
#> 
#> attr(,"class")
#> [1] "XYZ"     "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#>  1.0000000 -2.9389776  3.0000000  0.8935975 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#>      zmin      zmax 
#> -1.768048  1.152212 
#> attr(,"class")
#> [1] "z_range"
sfc_polygon( obj = df, x = 2, y = 3, z = 4, m = 5)
#> [[1]]
#> [[1]]
#>       [,1]        [,2]       [,3]         [,4]
#>  [1,]    1  0.51432778 -0.8507169 -1.287214810
#>  [2,]    1 -1.75137511  0.5662016 -1.030040247
#>  [3,]    1  0.89359752  1.1522120  1.514089316
#>  [4,]    2  0.22303837 -0.7561974  0.346903586
#>  [5,]    2  0.58081659 -0.4892583  1.779441542
#>  [6,]    2 -0.17782142 -1.1660523  0.386630924
#>  [7,]    3  0.74096671 -0.4796690 -0.918695239
#>  [8,]    3 -0.99744308  0.1153482 -1.584336488
#>  [9,]    3 -2.93897756 -1.7680484 -0.084058892
#> [10,]    1  0.71901566 -1.4076389 -2.085070889
#> [11,]    1 -0.69800504  0.7091785  0.003567992
#> [12,]    1 -1.89412584 -1.2408429 -0.355770822
#> [13,]    2  0.07629925 -0.3683273  1.146359751
#> [14,]    2  0.87530850  0.4620801 -0.221188446
#> [15,]    2  0.45382739 -0.3228331  1.018179021
#> [16,]    1  0.51432778 -0.8507169 -1.287214810
#> 
#> attr(,"class")
#> [1] "XYZM"    "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#>  1.0000000 -2.9389776  3.0000000  0.8935975 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#>      zmin      zmax 
#> -1.768048  1.152212 
#> attr(,"class")
#> [1] "z_range"
#> attr(,"m_range")
#>      mmin      mmax 
#> -2.085071  1.779442 
#> attr(,"class")
#> [1] "m_range"

sfc_polygon( obj = df, polygon_id = "ml_id", linestring_id = "l_id" )
#> [[1]]
#> [[1]]
#>            [,1]       [,2]      [,3]       [,4]
#> [1,]  0.5143278 -0.8507169 -1.287215 -0.2637193
#> [2,] -1.7513751  0.5662016 -1.030040  1.6585423
#> [3,]  0.8935975  1.1522120  1.514089 -0.7740868
#> [4,]  0.5143278 -0.8507169 -1.287215 -0.2637193
#> 
#> [[2]]
#>            [,1]       [,2]      [,3]       [,4]
#> [1,]  0.2230384 -0.7561974 0.3469036 -0.9239379
#> [2,]  0.5808166 -0.4892583 1.7794415 -0.2755334
#> [3,] -0.1778214 -1.1660523 0.3866309 -0.5933997
#> [4,]  0.2230384 -0.7561974 0.3469036 -0.9239379
#> 
#> [[3]]
#>            [,1]       [,2]        [,3]       [,4]
#> [1,]  0.7409667 -0.4796690 -0.91869524 -0.1222859
#> [2,] -0.9974431  0.1153482 -1.58433649  1.1797842
#> [3,] -2.9389776 -1.7680484 -0.08405889  0.6410374
#> [4,]  0.7409667 -0.4796690 -0.91869524 -0.1222859
#> 
#> attr(,"class")
#> [1] "XYZM"    "POLYGON" "sfg"    
#> 
#> [[2]]
#> [[1]]
#>            [,1]       [,2]         [,3]       [,4]
#> [1,]  0.7190157 -1.4076389 -2.085070889 -0.6295885
#> [2,] -0.6980050  0.7091785  0.003567992 -0.8077350
#> [3,] -1.8941258 -1.2408429 -0.355770822 -0.8604899
#> [4,]  0.7190157 -1.4076389 -2.085070889 -0.6295885
#> 
#> [[2]]
#>            [,1]       [,2]       [,3]       [,4]
#> [1,] 0.07629925 -0.3683273  1.1463598 -2.1692387
#> [2,] 0.87530850  0.4620801 -0.2211884 -1.3758365
#> [3,] 0.45382739 -0.3228331  1.0181790 -0.4931325
#> [4,] 0.07629925 -0.3683273  1.1463598 -2.1692387
#> 
#> attr(,"class")
#> [1] "XYZM"    "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#> -2.9389776 -1.7680484  0.8935975  1.1522120 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#>      zmin      zmax 
#> -2.085071  1.779442 
#> attr(,"class")
#> [1] "z_range"
#> attr(,"m_range")
#>      mmin      mmax 
#> -2.169239  1.658542 
#> attr(,"class")
#> [1] "m_range"
sfc_polygon( obj = df, polygon_id = 1, linestring_id = 2 )
#> [[1]]
#> [[1]]
#>            [,1]       [,2]      [,3]       [,4]
#> [1,]  0.5143278 -0.8507169 -1.287215 -0.2637193
#> [2,] -1.7513751  0.5662016 -1.030040  1.6585423
#> [3,]  0.8935975  1.1522120  1.514089 -0.7740868
#> [4,]  0.5143278 -0.8507169 -1.287215 -0.2637193
#> 
#> [[2]]
#>            [,1]       [,2]      [,3]       [,4]
#> [1,]  0.2230384 -0.7561974 0.3469036 -0.9239379
#> [2,]  0.5808166 -0.4892583 1.7794415 -0.2755334
#> [3,] -0.1778214 -1.1660523 0.3866309 -0.5933997
#> [4,]  0.2230384 -0.7561974 0.3469036 -0.9239379
#> 
#> [[3]]
#>            [,1]       [,2]        [,3]       [,4]
#> [1,]  0.7409667 -0.4796690 -0.91869524 -0.1222859
#> [2,] -0.9974431  0.1153482 -1.58433649  1.1797842
#> [3,] -2.9389776 -1.7680484 -0.08405889  0.6410374
#> [4,]  0.7409667 -0.4796690 -0.91869524 -0.1222859
#> 
#> attr(,"class")
#> [1] "XYZM"    "POLYGON" "sfg"    
#> 
#> [[2]]
#> [[1]]
#>            [,1]       [,2]         [,3]       [,4]
#> [1,]  0.7190157 -1.4076389 -2.085070889 -0.6295885
#> [2,] -0.6980050  0.7091785  0.003567992 -0.8077350
#> [3,] -1.8941258 -1.2408429 -0.355770822 -0.8604899
#> [4,]  0.7190157 -1.4076389 -2.085070889 -0.6295885
#> 
#> [[2]]
#>            [,1]       [,2]       [,3]       [,4]
#> [1,] 0.07629925 -0.3683273  1.1463598 -2.1692387
#> [2,] 0.87530850  0.4620801 -0.2211884 -1.3758365
#> [3,] 0.45382739 -0.3228331  1.0181790 -0.4931325
#> [4,] 0.07629925 -0.3683273  1.1463598 -2.1692387
#> 
#> attr(,"class")
#> [1] "XYZM"    "POLYGON" "sfg"    
#> 
#> attr(,"n_empty")
#> [1] 0
#> attr(,"crs")
#> $input
#> [1] NA
#> 
#> $wkt
#> [1] NA
#> 
#> attr(,"class")
#> [1] "crs"
#> attr(,"class")
#> [1] "sfc_POLYGON" "sfc"        
#> attr(,"precision")
#> [1] 0
#> attr(,"bbox")
#>       xmin       ymin       xmax       ymax 
#> -2.9389776 -1.7680484  0.8935975  1.1522120 
#> attr(,"class")
#> [1] "bbox"
#> attr(,"z_range")
#>      zmin      zmax 
#> -2.085071  1.779442 
#> attr(,"class")
#> [1] "z_range"
#> attr(,"m_range")
#>      mmin      mmax 
#> -2.169239  1.658542 
#> attr(,"class")
#> [1] "m_range"