Functions that reveal whether a geometry is closed, empty, or simple
ST_IsClosed shows whether a given linestring or multilinestring is closed. ST_IsEmpty shows whether a given geometry is empty, and ST_IsSimple shows whether a geometry is simple.
A linestring is closed if the start point and end point of the linestring are the same. A geometry is empty when it is devoid of points, and a geometry is simple when its configuration is typical.
ST_IsClosed
ST_IsClosed takes a linestring or multilinestring as an input parameter and returns 1 if the given linestring or multilinestring is closed. Otherwise, 0 (zero) is returned.
A linestring is closed if the start point and end point are equal. If the linestring has Z coordinates, the Z coordinates of the start point and end point must be equal. Otherwise, the points are not considered equal, and the linestring is not closed. A multilinestring is closed if each of its linestrings are closed.
ST_IsEmpty
ST_IsEmpty takes a geometry as an input parameter and returns 1 if the given geometry is empty. Otherwise 0 (zero) is returned.
A geometry is empty if it does not have any points that define it.
ST_IsSimple
ST_IsSimple takes a geometry as an input parameter and returns 1 if the given geometry is simple. Otherwise, 0 (zero) is returned.
Points, polygons, and multipolygons are always simple. A linestring is simple if it does not pass through the same point twice. A multipoint is simple if it does not contain two equal points, and a multilinestring is simple if all of its linestrings are simple and the only intersections occur at points that are on the boundary of the linestrings in the multilinestring.