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
| Parameter | Type | Description |
|---|---|---|
sfmeshObject1, sfmeshObject2 | sfmesh | Two sfmesh objects to merge. |
sfmesh_array | sfmesh[] | An array of sfmesh objects to merge. |
sfmesh_set | setofsfmesh | A 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
sfmeshobjects directly.Variant 2 accepts an array of
sfmeshobjects.Variant 3 accepts a set of
sfmeshobjects.
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;