For the complete documentation index, see llms.txt. This page is also available as Markdown.

ST_IsSimple

Checks whether a geometry is simple, with no self-intersections or repeated points. Returns 1 if it is simple, 0 if not, and NULL for a NULL argument.

Syntax

ST_IsSimple(g)
IsSimple(g)

Description

Returns 1 if the geometry g is simple, 0 if it is not, and NULL if g is NULL.

A geometry is simple if it has no anomalous geometric points, such as self-intersections or self-tangency:

  • A POINT is always simple.

  • A LINESTRING is simple if it does not cross or touch itself. A closed LINESTRING, whose first and last points are the same, is simple if it does not touch itself anywhere else.

  • A MULTIPOINT is simple if no two of its points are the same.

ST_IsSimple() and IsSimple() are synonyms.

Examples

A POINT is always simple.

SET @g = 'Point(1 2)';

SELECT ST_ISSIMPLE(GEOMFROMTEXT(@g));
+-------------------------------+
| ST_ISSIMPLE(GEOMFROMTEXT(@g)) |
+-------------------------------+
|                             1 |
+-------------------------------+

A LINESTRING that crosses itself is not simple:

A closed LINESTRING that does not cross itself is simple:

A MULTIPOINT with a repeated point is not simple:

This page is licensed: CC BY-SA / Gnu FDL

spinner

Last updated

Was this helpful?