shapely.get_num_coordinates#

get_num_coordinates(geometry, **kwargs)#

Returns the total number of coordinates in a geometry.

Returns 0 for not-a-geometry values.

Parameters
geometryGeometry or array_like
**kwargs

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

Examples

>>> from shapely import GeometryCollection, LineString, Point
>>> point = Point(0, 0)
>>> get_num_coordinates(point)
1
>>> get_num_coordinates(Point(0, 0, 0))
1
>>> line = LineString([(0, 0), (1, 1)])
>>> get_num_coordinates(line)
2
>>> get_num_coordinates(GeometryCollection([point, line]))
3
>>> get_num_coordinates(None)
0