st_zm: Drop or add Z and/or M dimensions from feature geometries

Description Usage Arguments Details Examples

View source: R/sfc.R

Description

Drop Z and/or M dimensions from feature geometries, resetting classes appropriately

Usage

1
st_zm(x, ..., drop = TRUE, what = "ZM")

Arguments

x

object of class sfg, sfc or sf

...

ignored

drop

logical; drop, or (FALSE) add?

what

character which dimensions to drop or add

Details

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.

Examples

1
2
3
4
5
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)

sf documentation built on July 24, 2019, 5:05 p.m.