sfg_multilinestring | R Documentation |
constructs sfg MULTILINESTRING object
sfg_multilinestring(
obj,
x = NULL,
y = NULL,
z = NULL,
m = NULL,
linestring_id = NULL
)
obj |
matrix or data.frame |
x |
x geometry column |
y |
y geometry column |
z |
z geometry column |
m |
m geometry column |
linestring_id |
column of ids for lines |
sfg
object of MULTILINESTRING geometry
sfg_multilinestring( matrix( 1:24, ncol = 2 ) )
sfg_multilinestring( matrix( 1:24, ncol = 3 ) )
sfg_multilinestring( matrix( 1:24, ncol = 4 ) )
## different lines
m <- cbind( matrix( 1:24, ncol = 2 ), c(rep(1, 6), rep(2, 6) ) )
sfg_multilinestring( obj = m, x = 1, y = 2, linestring_id = 3 )
## just specifying linestring_id will use all others as the geometries
sfg_multilinestring( obj = m, linestring_id = 3 )
df <- data.frame( x = 1:12, y = 1:12, z = 13:24, id = c(rep(1,6), rep(2,6)))
sfg_multilinestring( df, x = "x", y = "y" )
sfg_multilinestring( df, x = "x", y = "y", linestring_id = "id" )
sfg_multilinestring( df, linestring_id = "id" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.