Learn R Programming

fmesher (version 0.7.0)

fm_zm: Add or remove Z/M information

Description

[Experimental] Add and/or remove Z and/or M information from simple feature geometries.

Usage

fm_zm(x, ...)

# S3 method for sf fm_zm(x, ...)

# S3 method for sfc fm_zm(x, ..., add = NULL, remove = NULL, target = NULL)

# S3 method for list fm_zm(x, ..., add = NULL, remove = NULL, target = NULL)

# S3 method for sfg fm_zm(x, ..., add = NULL, remove = NULL, target = NULL)

# S3 method for numeric fm_zm(x, ..., add = NULL, remove = NULL, target = NULL, input = NULL)

# S3 method for matrix fm_zm(x, ..., add = NULL, remove = NULL, target = NULL, input = NULL)

fm_zm_input(x, ...)

# S3 method for sf fm_zm_input(x, ...)

# S3 method for sfc fm_zm_input(x, ...)

# S3 method for list fm_zm_input(x, ...)

# S3 method for sfg fm_zm_input(x, ...)

# S3 method for numeric fm_zm_input(x, ..., input = NULL)

# S3 method for matrix fm_zm_input(x, ..., input = NULL)

fm_zm_target(input, add = NULL, remove = NULL, target = NULL)

Value

An object of the same class as x, with modified Z/M dimensions.

Arguments

x

An object to modify

...

Further arguments passed to methods

add

character; one of NULL, "Z", "M", or "ZM". Specifies which dimensions to add.

remove

character; one of NULL, "Z", "M", or "ZM". Specifies which dimensions to remove.

target

character; one of "XY", "XYZ", "XYM", or "XYZM". Specifies the target dimension format. If provided, overrides add and remove. When both add and remove are NULL, the default target is the smallest format that can hold all the inputs without loss of information.

input

character or character vector; one of NULL, "XY", "XYZ", "XYM", or "XYZM". Specifies the input dimension format. If NULL (default), the input format is inferred from the number of columns in x (for matrices/numerics) or from the geometry type (for sfc objects).

Functions

  • fm_zm_input(): Find the set of distinct XY/XYZ/XYM/XYZM types

  • fm_zm_target(): Determines the target XY/XYZ/XYM/XYZM format

Author

Finn Lindgren Finn.Lindgren@gmail.com

See Also

sf::st_zm() that supports a subset of these operations.

Examples

Run this code
fm_zm(fmexample$loc_sf, add = "Z")

fm_zm_input(fmexample$loc_sf)

fm_zm_target(c("XY", "XYZ"))
fm_zm_target("XY", add = "Z")
fm_zm_target(c("XY", "XYZM"), remove = "M")

Run the code above in your browser using DataLab