sf_point.Rd
constructs sf of POINT objects
sf_point(obj, x = NULL, y = NULL, z = NULL, m = NULL, keep = FALSE)
obj | sorted vector, matrix or data.frame |
---|---|
x | x geometry column |
y | y geometry column |
z | z geometry column |
m | m geometry column |
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 POINT geometries
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.
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.
#> geometry #> 1 1, 2, 3#> geometry #> 1 1, 6 #> 2 2, 7 #> 3 3, 8 #> 4 4, 9 #> 5 5, 10#> geometry #> 1 1, 6 #> 2 2, 7 #> 3 3, 8 #> 4 4, 9 #> 5 5, 10sf_point( obj = x, x = "x", y = "y" )#> geometry #> 1 1, 6 #> 2 2, 7 #> 3 3, 8 #> 4 4, 9 #> 5 5, 10sf_point( obj = x, x = "y", y = "x" )#> geometry #> 1 6, 1 #> 2 7, 2 #> 3 8, 3 #> 4 9, 4 #> 5 10, 5# keeping properties x$val <- letters[1:5] sf_point( x, x = "x", y = "y", keep = TRUE )#> val geometry #> 1 a 1, 6 #> 2 b 2, 7 #> 3 c 3, 8 #> 4 d 4, 9 #> 5 e 5, 10