ST_Collect()

Combines two geometries into a multi-geometry or geometry collection.

Syntax

ST_Collect(geom1, geom2)

Arguments

Argument

Description

geom1

First GEOMETRY or GEOMETRY32 value.

geom2

Second value from the same geometry family.

Return Value

Returns a geometry in the input geometry family.

Usage Notes

Examples

DROP DATABASE IF EXISTS geo_operation_demo;
CREATE DATABASE geo_operation_demo;
USE geo_operation_demo;

SELECT ST_AsText(ST_Collect(ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(1 1)'))) AS collected;

DROP DATABASE geo_operation_demo;

See Also

Geo Functions Overview