sf_linestring.Rd
constructs sf of LINESTRING objects
sf_linestring(obj = NULL, x = NULL, y = NULL, z = NULL, m = NULL, linestring_id = NULL, keep = FALSE)
obj | sorted 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 linestrings |
keep | logical indicating if the non-geometry and non-id columns should be kept. if TRUE you must supply the geometry and id columns, and only the first row of each geometry is kept. See Keeping Properties. |
sf
object of LINESTRING geometries
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.
Setting keep = TRUE
will retain the first row of any columns not specified as a
coordinate (x, y, z, m) or an id (e.g., linestring_id, polygon_id) of the input obj
.
The sf_*
functions assume the input obj
is a long data.frame / matrix,
where any properties are repeated down the table for the same geometry.
#> id geometry #> 1 1 1, 2, 3, 4#> id geometry #> 1 1 1, 2, 1, 2, 2, 1sf_linestring( x, x = "x", y = "y" )#> id geometry #> 1 1 1, 2, 2, 1sf_linestring( x, x = "y", y = "x" )#> id geometry #> 1 1 2, 1, 1, 2sf_linestring( x, linestring_id = "id", x = "x", y = "y")#> id geometry #> 1 1 1, 2 #> 2 2 2, 1