has.z: Does a SpatVector have Z coordinates?

has.zR Documentation

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 signature 'SpatVector'
has.z(x)

Arguments

x

SpatVector

Value

logical

See Also

geom, crds, vect

Examples

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

terra documentation built on Aug. 22, 2026, 5:07 p.m.