Fork me on GitHub

ST_IsRectangle

Signature

BOOLEAN ST_IsRectangle(GEOMETRY geom);

Description

Returns true if geom is a rectangle.

Examples

SELECT ST_IsRectangle('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))');
-- Answer:    TRUE

SELECT ST_IsRectangle('POLYGON((0 0, 10 0, 10 7, 0 5, 0 0))');
-- Answer:    FALSE

See also