shapely.has_z

Contents

shapely.has_z#

has_z(geometry, **kwargs)#

Returns True if a geometry has a Z coordinate.

Note that this function returns False if the (first) Z coordinate equals NaN or if the geometry is empty.

Parameters:
geometryGeometry or array_like
**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> from shapely import Point
>>> has_z(Point(0, 0))
False
>>> has_z(Point(0, 0, 0))
True
>>> has_z(Point(0, 0, float("nan")))
False