shapely.get_num_points

Contents

shapely.get_num_points#

get_num_points(geometry, **kwargs)#

Returns number of points in a linestring or linearring.

Returns 0 for not-a-geometry values.

Parameters:
geometryGeometry or array_like

The number of points in geometries other than linestring or linearring equals zero.

**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> from shapely import LineString, MultiPoint
>>> get_num_points(LineString([(0, 0), (1, 1), (2, 2), (3, 3)]))
4
>>> get_num_points(MultiPoint([(0, 0), (1, 1), (2, 2), (3, 3)]))
0
>>> get_num_points(None)
0