shapely.count_coordinates

shapely.count_coordinates#

count_coordinates(geometry)#

Count the number of coordinate pairs in a geometry array.

Parameters:
geometryGeometry or array_like

Geometry or geometries to count the coordinates of.

Examples

>>> import shapely
>>> from shapely import LineString, Point
>>> shapely.count_coordinates(Point(0, 0))
1
>>> shapely.count_coordinates(LineString([(2, 2), (4, 2)]))
2
>>> shapely.count_coordinates(None)
0
>>> shapely.count_coordinates([Point(0, 0), None])
1