shapely.get_coordinate_dimension#
- get_coordinate_dimension(geometry, **kwargs)#
Returns the dimensionality of the coordinates in a geometry (2 or 3).
Returns -1 for missing geometries (
None
values).Note that with GEOS < 3.12, if the first Z coordinate equals
nan
, this function will return2
.- Parameters:
- geometryGeometry or array_like
- **kwargs
See NumPy ufunc docs for other keyword arguments.
Examples
>>> from shapely import Point >>> get_coordinate_dimension(Point(0, 0)) 2 >>> get_coordinate_dimension(Point(0, 0, 1)) 3 >>> get_coordinate_dimension(None) -1