shapely.has_z

Contents

shapely.has_z#

has_z(geometry, **kwargs)#

Return True if a geometry has Z coordinates.

Note that for GEOS < 3.12 this function returns False if the (first) Z coordinate equals NaN.

Parameters:
geometryGeometry or array_like

Geometry or geometries to check for Z coordinates.

**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> import shapely
>>> from shapely import Point
>>> shapely.has_z(Point(0, 0))
False
>>> shapely.has_z(Point(0, 0, 0))
True
>>> shapely.has_z(Point())
False