Basic examples of each type of simple feature geometry. sfzoo is a list with each of point, multipoin, linestring, multilinestring, polygon and multipolygon. sfgc is a GEOMETRYCOLLECTION of all the types in sfzoo.

Examples

lapply(sfzoo, sc_coord)
#> $point
#> # A tibble: 1 × 2
#>      x_    y_
#>   <dbl> <dbl>
#> 1     1     2
#> 
#> $multipoint
#> # A tibble: 6 × 2
#>      x_    y_
#>   <dbl> <dbl>
#> 1   3.2   4  
#> 2   3     4.6
#> 3   3.8   4.4
#> 4   3.5   3.8
#> 5   3.4   3.6
#> 6   3.9   4.5
#> 
#> $linestring
#> # A tibble: 4 × 2
#>      x_    y_
#>   <dbl> <dbl>
#> 1     0     3
#> 2     0     4
#> 3     1     5
#> 4     2     5
#> 
#> $multilinestring
#>     x_  y_
#> 1  0.0 3.0
#> 2  0.0 4.0
#> 3  1.0 5.0
#> 4  2.0 5.0
#> 5  0.2 3.0
#> 6  0.2 4.0
#> 7  1.0 4.8
#> 8  2.0 4.8
#> 9  0.0 4.4
#> 10 0.6 5.0
#> 
#> $polygon
#>    x_ y_
#> 1   0  0
#> 2   1  0
#> 3   3  2
#> 4   2  4
#> 5   1  4
#> 6   0  0
#> 7   1  1
#> 8   1  2
#> 9   2  2
#> 10  1  1
#> 
#> $multipolygon
#> # A tibble: 24 × 2
#>       x_    y_
#>    <dbl> <dbl>
#>  1     0     0
#>  2     1     0
#>  3     3     2
#>  4     2     4
#>  5     1     4
#>  6     0     0
#>  7     1     1
#>  8     1     2
#>  9     2     2
#> 10     1     1
#> # ℹ 14 more rows
#> 
lapply(sfzoo, sc_path)
#> $point
#> # A tibble: 1 × 4
#>    nrow  ncol type  path_ 
#>   <dbl> <dbl> <chr> <chr> 
#> 1     1     2 POINT BG5uUx
#> 
#> $multipoint
#> # A tibble: 1 × 4
#>    nrow  ncol type       path_ 
#>   <int> <int> <chr>      <chr> 
#> 1     6     2 MULTIPOINT zqUL0R
#> 
#> $linestring
#> # A tibble: 1 × 4
#>    nrow  ncol type       path_ 
#>   <int> <int> <chr>      <chr> 
#> 1     4     2 LINESTRING ZeG40N
#> 
#> $multilinestring
#> # A tibble: 3 × 4
#>    nrow  ncol type            path_ 
#>   <int> <int> <chr>           <chr> 
#> 1     4     2 MULTILINESTRING 0JGSJh
#> 2     4     2 MULTILINESTRING cCkeOp
#> 3     2     2 MULTILINESTRING 9bFr9x
#> 
#> $polygon
#> # A tibble: 2 × 4
#>    nrow  ncol type    path_ 
#>   <int> <int> <chr>   <chr> 
#> 1     6     2 POLYGON 28wtcm
#> 2     4     2 POLYGON G3Ox0S
#> 
#> $multipolygon
#> # A tibble: 5 × 5
#>    nrow  ncol type         subobject path_ 
#>   <int> <int> <chr>            <int> <chr> 
#> 1     6     2 MULTIPOLYGON         1 jBtJZ9
#> 2     4     2 MULTIPOLYGON         1 6IzLxM
#> 3     5     2 MULTIPOLYGON         2 Ye5HBT
#> 4     5     2 MULTIPOLYGON         2 FcD4IS
#> 5     4     2 MULTIPOLYGON         3 imkcvm
#> 

## unsure how useful this is ...
sc_path(sfgc)
#> $point
#> # A tibble: 1 × 4
#>    nrow  ncol type  path_ 
#>   <dbl> <dbl> <chr> <chr> 
#> 1     1     2 POINT Ai7Bl5
#> 
#> $multipoint
#> # A tibble: 1 × 4
#>    nrow  ncol type       path_ 
#>   <int> <int> <chr>      <chr> 
#> 1     6     2 MULTIPOINT Ho0nGq
#> 
#> $linestring
#> # A tibble: 1 × 4
#>    nrow  ncol type       path_ 
#>   <int> <int> <chr>      <chr> 
#> 1     4     2 LINESTRING wfCT4Y
#> 
#> $multilinestring
#> # A tibble: 3 × 4
#>    nrow  ncol type            path_ 
#>   <int> <int> <chr>           <chr> 
#> 1     4     2 MULTILINESTRING hTsowP
#> 2     4     2 MULTILINESTRING AzjrJz
#> 3     2     2 MULTILINESTRING KAXn7t
#> 
#> $polygon
#> # A tibble: 2 × 4
#>    nrow  ncol type    path_ 
#>   <int> <int> <chr>   <chr> 
#> 1     6     2 POLYGON l0aP9A
#> 2     4     2 POLYGON HUSsg2
#> 
#> $multipolygon
#> # A tibble: 5 × 5
#>    nrow  ncol type         subobject path_ 
#>   <int> <int> <chr>            <int> <chr> 
#> 1     6     2 MULTIPOLYGON         1 aODuXS
#> 2     4     2 MULTIPOLYGON         1 1n3kiD
#> 3     5     2 MULTIPOLYGON         2 14u2A8
#> 4     5     2 MULTIPOLYGON         2 cHGSCN
#> 5     4     2 MULTIPOLYGON         3 eoPbEO
#>