Fungsi ini mengonversi trajektori menjadi tabel dalam database.
Sintaksis
trajectory ST_AsTable (trajectory traj);Parameter
| Parameter | Deskripsi |
| traj | Trajektori asli. |
Deskripsi
Fungsi ini mengonversi trajektori menjadi tabel. Format tabel harus sesuai dengan Sintaksis 5 pada topik ST_makeTrajectory.
Contoh
-- Output tuple
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"]}}'::trajectory a
)
select ST_AsTable(a) from traj;
st_astable
-----------------------------
("2010-01-01 11:30:00",1,1)
("2010-01-01 12:30:00",3,5)
(2 baris)
-- Output table
select * from ST_AsTable('{"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"]}}'::trajectory) as f(t timestamp,x double precision, y double precision);
t | x | y
---------------------+---+---
2010-01-01 11:30:00 | 1 | 1
2010-01-01 12:30:00 | 3 | 5
(2 baris)