文档

ST_CurveRecognize

更新时间:

该函数用于识别轨迹中的弯道、转弯半径。

语法

  • 语法一:

    SETOF trpeak ST_CurveRecognize (trajectory traj, float8 radius_threshold, float8 angle_threshold, float8 angle_compress_threshold default 0);
  • 语法二:

    SETOF trpeak ST_CurveRecognize (trajectory traj, float8 radius_threshold, float8 angle_threshold, float8 expansion_radius1, float8 expansion_radius2,float8 angle_compress_threshold default 0);

参数

参数

描述

traj

原始轨迹。

radius_threshold

在识别弯道中心点时,需要设置一个转动半径。

根据参数radius_threshold,寻找所有转动半径小于radius_threshold参数值的点,在每一段连续的点中,将转动半径最小的点作为弯道中心。

angle_threshold

用于设置一个转向角,与弯道边界点的转向角进行比较,去除小于此参数值的点。

expansion_radius1

弯道点所需的转动半径。

expansion_radius2

弯道点到弯道中心路径上所需的平均转动半径。

angle_compress_threshold

如果弯道点的转向角度小于此参数值,则不采样,用于简化采样密度,防止采样密度过高导致弯道无法识别。

返回值说明:

参数

描述

loc

指弯道中心位置,表示弯道中心点是轨迹中的第几个折点。

例如,如果loc为n,则弯道中心点是轨迹的第n+1个折点。

height

弯道中心的转动半径。正值表示顺时针,负值表示逆时针。

startloc

弯道起始点。

endloc

弯道终止点。

描述

弯道识别主要分为如下步骤:

  1. 根据参数radius_threshold,寻找所有转动半径小于radius_threshold参数值的点,在每一段连续的点中,将转动半径最小的点作为弯道中心。

  2. 每个弯道中心,根据参数expansion_radius1expansion_radius2,选取其邻接的点作为轨迹的组成点。选取的点需要满足如下条件:

    1. 转动半径值小于expansion_radius1参数值。

    2. 从弯道中心点到此点的转动半径均值小于expansion_radius2参数值。

    说明

    如果不指定expansion_radius1expansion_radius2,则可以使用语法一,默认expansion_radius1 = radius_threshold * 2expansion_radius2 = radius_threshold * 4

  3. 根据angle_threshold对弯道的边界进行修剪,使弯道边界点的转角大于angle_threshold参数值。当原有的边界转角较大时,边界会向两侧扩张,否则,则会向内收缩。

示例

SELECT (ST_CurveRecognize('{"trajectory":{"version":1,"type":"STPOINT","leafcount":16,"start_time":"2000-01-01 00:00:00","end_time":"2000-01-16 00:00:00","spatial":"LINESTRING(0 0,1 1,2 2,4 3,3 4,5 7,8 8,7 4,0 0,1 1,2 2,4 3,3 4,5 7,8 8,7 4)","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","2000-01-08 00:00:00","2000-01-09 00:00:00","2000-01-10 00:00:00","2000-01-11 00:00:00","2000-01-12 00:00:00","2000-01-13 00:00:00","2000-01-14 00:00:00","2000-01-15 00:00:00","2000-01-16 00:00:00"]}}', 15, 1)).*;
 loc |      height       | startloc | endloc 
-----+-------------------+----------+--------
   2 |  5.70087712549569 |        2 |      2
   4 |  2.10237960416286 |        4 |      8
  10 |  5.70087712549569 |       10 |     10
  12 |  2.10237960416286 |       12 |     15
   3 | -1.17851130197758 |        3 |      3
  11 | -1.17851130197758 |       11 |     11
(6 rows)

  • 本页导读 (0)
文档反馈