shapely.is_ccw
shapely.is_ccw#
- is_ccw(geometry, **kwargs)#
Returns True if a linestring or linearring is counterclockwise.
Note
‘is_ccw’ requires at least GEOS 3.7.0.
Note that there are no checks on whether lines are actually closed and not self-intersecting, while this is a requirement for is_ccw. The recommended usage of this function for linestrings is
is_ccw(g) & is_simple(g)
and for linearringsis_ccw(g) & is_valid(g)
.- Parameters
- geometryGeometry or array_like
This function will return False for non-linear goemetries and for lines with fewer than 4 points (including the closing point).
- **kwargs
For other keyword-only arguments, see the NumPy ufunc docs.
See also
Examples
>>> from shapely import LinearRing, LineString, Point >>> is_ccw(LinearRing([(0, 0), (0, 1), (1, 1), (0, 0)])) False >>> is_ccw(LinearRing([(0, 0), (1, 1), (0, 1), (0, 0)])) True >>> is_ccw(LineString([(0, 0), (1, 1), (0, 1)])) False >>> is_ccw(Point(0, 0)) False