Learn R Programming

terra (version 1.9-46)

has.z: Does a SpatVector have Z coordinates?

Description

Returns TRUE if any geometry part (or polygon hole) stores Z values.

Z storage is optional: empty Z means a conventional 2D geometry. When Z is present it is included in geom and crds, preserved by writeVector / vect file I/O (25D geometries), and by coercion to/from sf (see also https://github.com/rspatial/terra/issues/824).

Usage

# S4 method for SpatVector
has.z(x)

Value

logical

Arguments

x

SpatVector

See Also

geom, crds, vect

Examples

Run this code
v <- vect(cbind(1:3, 1:3))
has.z(v)

Run the code above in your browser using DataLab