All Products
Search
Document Center

:ST_AttrAppend

Last Updated:Apr 07, 2023

This topic describes the ST_AttrAppend function. This function adds an attribute to a VOMesh object.

Syntax

VOMesh ST_AttrAppend(VOMesh vomeshObject, cstring part, cstring name, anyarray data);

Parameters

Parameter

Description

vomeshObject

The VOMesh object.

name

The name of the attribute. This parameter cannot be an empty string.

part

The position to which you want to add the attribute. Valid values:

  • VERTEX

  • FACE

  • CELL

For more information about VERTEX, FACE, and CELL, see VOMesh definitions.

data

The data of the array type. The following data types are supported: int2, int4, float4, and float8.

  • A one-dimensional array is automatically mapped to the scalar type.

  • A two-dimensional array is automatically mapped to the vector type.

Examples

SELECT ST_AsText(
  ST_AttrAppend(
    'VOMESH(VERTEX(COORDS(1 2 3,4 5 6,7 8 9,10 11 12,13 14 15), ATTRS(ATTR(NAME(color), TYPE(int1),SCALAR(1,2, 3, 4, 5)))),FACE(INDEX((0,1,2,3),(2,3,4))),CELL(INDEX((0,1,2,3),(3,4,5,6)),DIRECTION((0,1,1,1),(1,1,0,0))))'::phmesh, 'vertex', 'myname', '{9,8,3,4,3}'::int2[]
  )
);

----------
 VOMESH(VERTEX(COORDS(1 2 3,4 5 6,7 8 9,10 11 12,13 14 15),ATTRS(ATTR(NAME(
color),TYPE(int1),SCALAR(1,2,3,4,5)),ATTR(NAME(myname),TYPE(int2),SCALAR(9,
8,3,4,3)))),FACE(INDEX((0,1,2,3),(2,3,4))),CELL(INDEX((0,1,2,3),(3,4,5,6)),
DIRECTION((0,1,1,1),(1,1,0,0))))

SELECT ST_AsText(
  ST_AttrAppend(
    'VOMESH(VERTEX(COORDS(1 2 3,4 5 6,7 8 9,10 11 12,13 14 15), ATTRS(ATTR(NAME(color), TYPE(int1),SCALAR(1,2, 3, 4, 5)))),FACE(INDEX((0,1,2,3),(2,3,4))),CELL(INDEX((0,1,2,3),(3,4,5,6)),DIRECTION((0,1,1,1),(1,1,0,0))))'::phmesh, 'vertex', 'myname', '{{9.1,8.2},{8.3,2.4},{3.5,7.6},{4.7,6.8},{3.9,5.1}}'::float8[]
  )
);

----------
 VOMESH(VERTEX(COORDS(1 2 3,4 5 6,7 8 9,10 11 12,13 14 15),ATTRS(ATTR(NAME(
color),TYPE(int1),SCALAR(1,2,3,4,5)),ATTR(NAME(myname),TYPE(double),VECTOR(
(9.1,8.2),(8.3,2.4),(3.5,7.6),(4.7,6.8),(3.9,5.1))))),FACE(INDEX((0,1,2,3),
(2,3,4))),CELL(INDEX((0,1,2,3),(3,4,5,6)),DIRECTION((0,1,1,1),(1,1,0,0))))