All Products
Search
Document Center

PolarDB:ST_Collect

Last Updated:Mar 28, 2026

Merges two or more sfmesh objects into a single sfmesh by combining their nodes.

Syntax

Variant 1: Two sfmesh objects

sfmesh ST_Collect(sfmesh sfmeshObject1, sfmesh sfmeshObject2);

Variant 2: An array of sfmesh objects

sfmesh ST_Collect(sfmesh[] sfmesh_array);

Variant 3: An aggregate set of sfmesh objects

sfmesh ST_Collect(setofsfmesh sfmesh_set);

Parameters

ParameterTypeDescription
sfmeshObject1, sfmeshObject2sfmeshTwo sfmesh objects to merge.
sfmesh_arraysfmesh[]An array of sfmesh objects to merge.
sfmesh_setsetofsfmeshA set of sfmesh objects to merge as an aggregate.

Description

ST_Collect merges sfmesh objects by combining their nodes and returns a single sfmesh.

  • Variant 1 accepts two sfmesh objects directly.

  • Variant 2 accepts an array of sfmesh objects.

  • Variant 3 accepts a set of sfmesh objects.

ST_Collect performs a node-level merge only. It does not crop or merge the geometries and textures of the input objects. To merge geometries and textures, use a different function.

Examples

Merge two sfmesh objects (Variant 1)

Merge two meshes selected by row number and display the result as text.

WITH tmp AS
(
    SELECT num, the_mesh
    FROM t_mesh
    WHERE num IN (1, 3)
)
SELECT a.num, b.num,
     ST_AsText(st_Collect(a.the_mesh, b.the_mesh))
FROM tmp a, tmp b;

Merge an array of sfmesh objects (Variant 2)

Pass multiple meshes as an array and display the result as text.

WITH tmp AS
(
    SELECT num, the_mesh
    FROM t_mesh
    WHERE num IN (1, 3, 13, 14)
)
SELECT a.num, b.num,
    ST_AsText(st_Collect(ARRAY[a.the_mesh, b.the_mesh]))
FROM tmp a, tmp b;

Aggregate all sfmesh objects in a table (Variant 3)

Collect all meshes in t_mesh into a single sfmesh and display the result as text.

WITH tmp AS
(
     SELECT num, the_mesh
     FROM t_mesh
)
SELECT
     ST_AsText(st_Collect(the_mesh))
FROM tmp;