この関数は、すべての軌道点をフィルターにかけて、指定された属性フィールドの値が固定値または値の範囲に基づくフィルター条件を満たす軌道点を取得し、これらの点の属性フィールド値の配列を返します。

構文

timestamp[] ST_attrTimestampFilter(trajectory traj, cstring attr_field_name,cstring operator, timestamp value);
timestamp[] ST_attrTimestampFilter(trajectory traj, cstring attr_field_name,cstring operator, timestamp value1, timestamp value2);

パラメーター

パラメーター 説明
traj 軌道オブジェクトです。
attr_field_name 指定された属性フィールドの名前です。
operator フィルター演算子です。 有効な値は、'='、'!='、'>'、'<'、'>='、'<='、'[]'、'(]'、'[)'、および '()' です。
value and value1 属性フィールドの固定値と属性フィールドの最小固定値です。
value2 属性フィールドの最大固定値です。

insert into traj values(3,ST_makeTrajectory('STPOINT'::leaftype, st_geomfromtext('LINESTRING (114 35, 115 36, 116 37)', 4326), ARRAY['2010-01-01 14:30'::timestamp, '2010-01-01 15:00', '2010-01-01 15:30'], '{"leafcount": 3, "attributes": {"heading": {"type": "timestamp", "nullable": false,"value":["Fri Jan 01 14:30:00 2010", "Fri Jan 01 15:00:00 2010", "Fri Jan 01 15:30:00 2010"]}}}'));
select st_attrTimestampFilter(traj, 'heading', '>', 'Fri Jan 01 15:00:00 2010'::timestamp) from traj where id = 3;
 st_attrtimestampfilter  
------------------------- 
{"2010-01-01 15:30:00"}
(1 row)