ST_IsSimple

更新时间:
复制 MD 格式

Tests whether a geometry has no points of self-intersection.

Syntax

boolean ST_IsSimple(geometry geomA);

Parameters

ParameterDescription
geomAThe geometry object to test.

Description

Returns true if the geometry has no self-intersection points, false otherwise.

This function supports 3D geometry and does not drop the Z coordinate.

Examples

The following statement returns true:

SELECT ST_IsSimple('LINESTRING(0 0,0 2,2 0,0 0)'::geometry);
 st_issimple
-------------
 t
(1 row)

The following statement returns false because the LINESTRING doubles back on itself, crossing the starting point:

SELECT ST_IsSimple('LINESTRING(0 0,0 2,0 0)'::geometry);
 st_issimple
-------------
 f
(1 row)