shapely.get_num_geometries#
- get_num_geometries(geometry, **kwargs)#
Return number of geometries in a collection.
Returns 0 for not-a-geometry values. The number of geometries in points, linestrings, linearrings and polygons equals one.
- Parameters:
- geometryGeometry or array_like
Geometry or geometries to get the number of geometries of.
- **kwargs
See NumPy ufunc docs for other keyword arguments.
See also
Examples
>>> import shapely >>> from shapely import MultiPoint, Point >>> shapely.get_num_geometries(MultiPoint([(0, 0), (1, 1), (2, 2), (3, 3)])) 4 >>> shapely.get_num_geometries(Point(1, 1)) 1 >>> shapely.get_num_geometries(None) 0