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

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