Skip to content
πŸŽ‰ SedonaDB 0.4.0 is out now! πŸ—ΊοΈ Python DataFrame API, R dplyr, Geography support & GPU-accelerated spatial joins. Read the release blog β†’

ST_IsLineStringCCW

Introduction: Returns true if the input LineString's coordinate sequence has counter-clockwise ring orientation.

ST_IsLineStringCCW

The input LineString does not need to be closed. Its existing coordinate sequence is evaluated without adding a closing coordinate. The function returns false for non-LineString geometries and LineStrings with fewer than four points.

Format: ST_IsLineStringCCW(geom: Geometry)

Return type: Boolean

Since: v1.9.1

SQL Example:

SELECT ST_IsLineStringCCW(ST_GeomFromWKT('LINESTRING (0 0, 1 0, 1 1, 0 1, 0 0)'))

Output:

true