Skip to content

ST_ISVALID

Checks if a GEOGRAPHY value is well-formed and valid in 2D according to OGC rules.

For GEOGRAPHY objects with 3 or 4 dimensions, validity is still tested only in 2D.

See also:

Syntax

sql
ST_ISVALID(<input>)

Arguments

  • <input>: The GEOGRAPHY object to be tested

Returns

Returns a BOOLEAN:

  • TRUE if the input GEOGRAPHY is valid
  • FALSE if the input GEOGRAPHY is invalid

Example

sql
SELECT ST_IsValid('POLYGON((0 0, 1 1, 1 0, 0 0))'::GEOGRAPHY);
-- TRUE

SELECT ST_IsValid('POLYGON((0 0, 1 1, 1 1, 0 0))'::GEOGRAPHY);
-- FALSE