指定軌跡屬性字段,根據固定值,過濾出符合條件的軌跡點,返回過濾后的屬性字段值(數組)。

語法

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、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)