shapely.get_num_coordinates

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

See NumPy ufunc docs for other keyword arguments.

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