shapely.get_z

Contents

shapely.get_z#

get_z(point, **kwargs)#

Returns the z-coordinate of a point.

Note

‘get_z’ requires at least GEOS 3.7.0.

Parameters:
pointGeometry or array_like

Non-point geometries or geometries without 3rd dimension will result in NaN being returned.

**kwargs

See NumPy ufunc docs for other keyword arguments.

See also

get_x, get_y

Examples

>>> from shapely import MultiPoint, Point
>>> get_z(Point(1, 2, 3))
3.0
>>> get_z(Point(1, 2))
nan
>>> get_z(MultiPoint([(1, 1, 1), (2, 2, 2)]))
nan