Drop Z and/or M dimensions from feature geometries, resetting classes appropriately
st_zm(x, ..., drop = TRUE, what = "ZM")
object of class sfg
, sfc
or sf
ignored
logical; drop, or (FALSE) add?
character which dimensions to drop or add
Only combinations drop=TRUE
, what = "ZM"
, and drop=FALSE
, what="Z"
are supported so far. In case add=TRUE
, x
should have XY
geometry, and zero values are added for Z
.
# NOT RUN {
st_zm(st_linestring(matrix(1:32,8)))
x = st_sfc(st_linestring(matrix(1:32,8)), st_linestring(matrix(1:8,2)))
st_zm(x)
a = st_sf(a = 1:2, geom=x)
st_zm(a)
# }
Run the code above in your browser using DataLab