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

For other keyword-only arguments, see the NumPy ufunc docs.

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