constructs sfg LINESTRING object
sfg_linestring(obj, x = NULL, y = NULL, z = NULL, m = NULL)
matrix or data.frame
x geometry column
y geometry column
z geometry column
m geometry column
sfg
object of LINESTRING geometry
sfg_linestring( 1:2 )
#> [,1] [,2]
#> [1,] 1 2
#> attr(,"class")
#> [1] "XY" "LINESTRING" "sfg"
sfg_linestring( 1:3 )
#> [,1] [,2] [,3]
#> [1,] 1 2 3
#> attr(,"class")
#> [1] "XYZ" "LINESTRING" "sfg"
sfg_linestring( 1:4 )
#> [,1] [,2] [,3] [,4]
#> [1,] 1 2 3 4
#> attr(,"class")
#> [1] "XYZM" "LINESTRING" "sfg"
sfg_linestring( matrix( 1:24, ncol = 2 ) )
#> [,1] [,2]
#> [1,] 1 13
#> [2,] 2 14
#> [3,] 3 15
#> [4,] 4 16
#> [5,] 5 17
#> [6,] 6 18
#> [7,] 7 19
#> [8,] 8 20
#> [9,] 9 21
#> [10,] 10 22
#> [11,] 11 23
#> [12,] 12 24
#> attr(,"class")
#> [1] "XY" "LINESTRING" "sfg"
sfg_linestring( matrix( 1:24, ncol = 3 ) )
#> [,1] [,2] [,3]
#> [1,] 1 9 17
#> [2,] 2 10 18
#> [3,] 3 11 19
#> [4,] 4 12 20
#> [5,] 5 13 21
#> [6,] 6 14 22
#> [7,] 7 15 23
#> [8,] 8 16 24
#> attr(,"class")
#> [1] "XYZ" "LINESTRING" "sfg"
sfg_linestring( matrix( 1:24, ncol = 4 ) )
#> [,1] [,2] [,3] [,4]
#> [1,] 1 7 13 19
#> [2,] 2 8 14 20
#> [3,] 3 9 15 21
#> [4,] 4 10 16 22
#> [5,] 5 11 17 23
#> [6,] 6 12 18 24
#> attr(,"class")
#> [1] "XYZM" "LINESTRING" "sfg"
sfg_linestring( matrix( 1:24, ncol = 4 ), x = 3, y = 2, z = 3)
#> [,1] [,2] [,3]
#> [1,] 13 7 13
#> [2,] 14 8 14
#> [3,] 15 9 15
#> [4,] 16 10 16
#> [5,] 17 11 17
#> [6,] 18 12 18
#> attr(,"class")
#> [1] "XYZ" "LINESTRING" "sfg"
sfg_linestring( data.frame( x = 1:10, y = 11:20 ) )
#> [,1] [,2]
#> [1,] 1 11
#> [2,] 2 12
#> [3,] 3 13
#> [4,] 4 14
#> [5,] 5 15
#> [6,] 6 16
#> [7,] 7 17
#> [8,] 8 18
#> [9,] 9 19
#> [10,] 10 20
#> attr(,"class")
#> [1] "XY" "LINESTRING" "sfg"
sfg_linestring( data.frame( x = 1:10, y = 11:20, z = 21:30 ) )
#> [,1] [,2] [,3]
#> [1,] 1 11 21
#> [2,] 2 12 22
#> [3,] 3 13 23
#> [4,] 4 14 24
#> [5,] 5 15 25
#> [6,] 6 16 26
#> [7,] 7 17 27
#> [8,] 8 18 28
#> [9,] 9 19 29
#> [10,] 10 20 30
#> attr(,"class")
#> [1] "XYZ" "LINESTRING" "sfg"
sfg_linestring( data.frame( x = 1:10, y = 11:20, z = 21:30 ), x = "x", y = "z" )
#> [,1] [,2]
#> [1,] 1 21
#> [2,] 2 22
#> [3,] 3 23
#> [4,] 4 24
#> [5,] 5 25
#> [6,] 6 26
#> [7,] 7 27
#> [8,] 8 28
#> [9,] 9 29
#> [10,] 10 30
#> attr(,"class")
#> [1] "XY" "LINESTRING" "sfg"