shapely.get_precision

Contents

shapely.get_precision#

get_precision(geometry, **kwargs)#

Get the precision of a geometry.

Note

‘get_precision’ requires at least GEOS 3.6.0.

If a precision has not been previously set, it will be 0 (double precision). Otherwise, it will return the precision grid size that was set on a geometry.

Returns NaN for not-a-geometry values.

Parameters:
geometryGeometry or array_like
**kwargs

See NumPy ufunc docs for other keyword arguments.

See also

set_precision

Examples

>>> from shapely import Point
>>> point = Point(1, 1)
>>> get_precision(point)
0.0
>>> geometry = set_precision(point, 1.0)
>>> get_precision(geometry)
1.0
>>> get_precision(None)
nan