ST_attrNullable
更新時(shí)間:
獲得軌跡屬性是否允許為空。
語(yǔ)法
bool ST_attrNullable(trajectory traj, integer index) ;
bool ST_attrNullable(trajectory traj, text name) ;
參數(shù)
參數(shù)名稱(chēng) | 描述 |
traj | 軌跡對(duì)象。 |
i?ndex | 索引軌跡項(xiàng)。 |
name | 屬性名稱(chēng)。 |
示例
With traj AS (
select '{"trajectory":{"version":1,"type":"STPOINT","leafcount":2,"start_time":"2010-01-01 11:30:00","end_time":"2010-01-01 12:30:00","spatial":"SRID=4326;LINESTRING(1 1,3 5)","timeline":["2010-01-01 11:30:00","2010-01-01 12:30:00"],"attributes":{"leafcount":2,"velocity":{"type":"integer","length":4,"nullable":true,"value":[1,null]},"speed":{"type":"float","length":8,"nullable":true,"value":[null,1.0]},"angel":{"type":"string","length":64,"nullable":true,"value":["test",null]}, "tngel2":{"type":"timestamp","length":8,"nullable":true,"value":["2010-01-01 12:30:00",null]},"bearing":{"type":"bool","length":1,"nullable":true,"value":[null,true]}}}}'::trajectory a)
Select st_attrNullable(a, 'velocity') from traj;
st_attrnullable
-----------------
t
(1 row)
With traj AS (
select '{"trajectory":{"version":1,"type":"STPOINT","leafcount":2,"start_time":"2010-01-01 11:30:00","end_time":"2010-01-01 12:30:00","spatial":"SRID=4326;LINESTRING(1 1,3 5)","timeline":["2010-01-01 11:30:00","2010-01-01 12:30:00"],"attributes":{"leafcount":2,"velocity":{"type":"integer","length":4,"nullable":true,"value":[1,null]},"speed":{"type":"float","length":8,"nullable":true,"value":[null,1.0]},"angel":{"type":"string","length":64,"nullable":true,"value":["test",null]}, "tngel2":{"type":"timestamp","length":8,"nullable":true,"value":["2010-01-01 12:30:00",null]},"bearing":{"type":"bool","length":1,"nullable":true,"value":[null,true]}}}}'::trajectory a)
Select st_attrNullable(a, 1) from traj;
st_attrnullable
-----------------
t
(1 row)
文檔內(nèi)容是否對(duì)您有幫助?