軌道サンプリング点から、指定したジオメトリック領域と交差する点を取得します。
構文
TABLE(idx integer, inside bool, pnt trajectory, t timestamp, x double precision, y double precision) ST_CrossingPoints(trajectory traj, geometry geom)パラメーター
パラメーター | 説明 |
traj | 軌道オブジェクト。 |
geom | 幾何学的エリア。 |
戻り値
次のパラメーターを含むデータテーブルが返されます。
パラメーター | 説明 |
idx | 0から始まる軌道サンプリングポイントのシーケンス番号。 |
内部 | 点が幾何学的領域内にあるかどうかを示します。 |
pnt | 単一点軌道の形式であり、属性情報を含む点。 |
t | ポイントのタイムスタンプ。 |
x | ポイントのx座標。 |
y | ポイントのy座標。 |
説明
軌道の前のサンプリング点が幾何学的領域の外側にあり、次のサンプリング点が幾何学的領域の内側にある場合、または前のサンプリング点が幾何学的領域の内側にあり、次のサンプリング点が幾何学的領域の外側にある場合、その点は幾何学的領域と交差している。 この関数は、交差点を異なる行に表示します。
例:
指定した幾何学的領域に出入りする軌道オブジェクトの交差点を照会します。
SELECT * FROM ST_CrossingPoints(
'{"trajectory":{"version":1,"type":"STPOINT","leafcount":7,"start_time":"2000-01-01 00:00:00","end_time":"2000-01-07 00:00:00","spatial":"LINESTRING(0 0,2 1,0 0,3 3,0 0,1 4,0 0)","timeline":["2000-01-01 00:00:00","2000-01-02 00:00:00","2000-01-03 00:00:00","2000-01-04 00:00:00","2000-01-05 00:00:00","2000-01-06 00:00:00","2000-01-07 00:00:00"]}}',
'POLYGON((2 2, 2 3, 3 3, 3 2, 2 2))');サンプル結果:
idx | inside | pnt | t | x | y
-----+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---+---
3 | t | {"trajectory":{"version":1,"type":"STPOINT","leafcount":1,"start_time":"2000-01-04 00:00:00","end_time":"2000-01-04 00:00:00","spatial":"POINT(3 3)","timeline":["2000-01-04 00:00:00"]}} | 2000-01-04 00:00:00 | 3 | 3
4 | f | {"trajectory":{"version":1,"type":"STPOINT","leafcount":1,"start_time":"2000-01-05 00:00:00","end_time":"2000-01-05 00:00:00","spatial":"POINT(0 0)","timeline":["2000-01-05 00:00:00"]}} | 2000-01-05 00:00:00 | 0 | 0
(2 rows)