sfg_multilinestring: sfg multilinestring

View source: R/sfg.R

sfg_multilinestringR Documentation

sfg multilinestring

Description

constructs sfg MULTILINESTRING object

Usage

sfg_multilinestring(
  obj,
  x = NULL,
  y = NULL,
  z = NULL,
  m = NULL,
  linestring_id = NULL
)

Arguments

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

Value

sfg object of MULTILINESTRING geometry

Examples


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" )



sfheaders documentation built on May 29, 2024, 1:36 a.m.