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: A set of sfmesh objects (aggregate)
sfmesh ST_Collect(setofsfmesh sfmesh_set);Parameters
| Parameter | Description |
|---|---|
sfmeshObject | An sfmesh object. Variant 1 accepts two sfmeshObject arguments. |
sfmesh_array | An array of sfmesh objects. |
sfmesh_set | A set of sfmesh objects used as aggregate input in Variant 3. |
Return value
Returns an sfmesh object containing the merged nodes of all input objects.
Usage notes
ST_Collect merges sfmesh objects at the node level only. It does not crop and merge the geometries and textures of the input objects.
Examples
Variant 1: Merge two sfmesh objects directly
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;Variant 2: Merge an array of sfmesh objects
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;Variant 3: Aggregate all sfmesh objects in a table
WITH tmp AS
(
SELECT num, the_mesh
FROM t_mesh
)
SELECT
ST_AsText(st_Collect(the_mesh))
FROM tmp;该文章对您有帮助吗?