ST_ISPOLYGON()

All functions > GEOSPATIAL > ST_ISPOLYGON()

Returns TRUE if the geometry or geography is a Polygon.

Signatures

Is polygon

Returns: TRUE if the sub kind is Polygon

ST_ISPOLYGON(geo: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
geoTYesGeometry or geography value

With:

  • T : Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY | GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY

Signature notes:

  • Transpiled as a ST_GEOMETRYTYPE comparison; the type label varies by engine
  • Returns FALSE for MultiPolygon; use ST_ISCOLLECTION for that
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := ST_ISPOLYGON(ST_GEOMFROMTEXT('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))')), -- A polygon is a polygon
    f2 := ST_ISPOLYGON(ST_GEOMPOINT(1.0, 2.0)) -- A point is not a polygon
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

Last update at: 2026/05/26 17:22:09