全部產品
Search
文件中心

AnalyticDB:ST_attrTimestampFilter

更新時間:Feb 05, 2024

指定軌跡屬性欄位,根據固定值,過濾出合格軌跡點,返回過濾後的屬性欄位值(數組)。

文法

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)