ST_IsCollection()

TL;DR

Use ST_IsCollection() to test whether a geometry is a collection type.

Returns whether a geometry is a collection type.

Syntax

ST_IsCollection(geom)

Arguments

Argument

Description

geom

A GEOMETRY or GEOMETRY32 value.

Return Value

Returns BOOL.

Usage Notes

  • The unary source tests show true for MULTIPOINT and false for POINT.

  • GEOMETRY32 support is covered by test/distributed/cases/geo/geo_review_fixes.sql.

Examples

DROP DATABASE IF EXISTS geo_iscollection_demo;
CREATE DATABASE geo_iscollection_demo;
USE geo_iscollection_demo;

SELECT ST_IsCollection(ST_GeomFromText('MULTIPOINT(1 1,2 2)')) AS is_collection;

DROP DATABASE geo_iscollection_demo;

See Also