日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

ST_lcsSubDistance

計算LCSS軌跡段與traj1在這段軌跡上的距離。

語法

float8 ST_lcsSubDisatance(trajectory traj1, trajectory traj2, float8 dist, distanceUnit unit default 'M');
float8 ST_lcsSubDisatance(trajectory traj1, trajectory traj2, float8 dist, interval lag, distanceUnit unit default 'M');

參數

參數名稱

描述

traj1

軌跡對象1。

traj2

軌跡對象2。

dist

兩點之間的距離容差,單位為米(m)。

lag

兩點之間的時間容差。

unit

距離單位,允許以下值:

  • m:米。

  • km:千米。

  • D:度。僅允許空間參考為 WGS84(4326)軌跡使用。

描述

本函數計算的是與LCSS軌跡段相對應的軌跡1子軌跡的點數與LCSS軌跡段的點數的比例關系。

上圖中軌跡點[2,3,5]為LCSS軌跡段,軌跡1與此對應的軌跡段為[2,3,4,5],返回的結果為1-3/4。

數值越小表明LCSS軌跡與軌跡1的相似度越高。

通常trajectory對象中會有srid值,如果trajectory對象沒有srid值,則默認為4326。

示例

With traj AS (
    Select ST_makeTrajectory('STPOINT', 'LINESTRINGZ(114.000528 33.588163 54.87 , 114.000535 33.588235 54.85 , 114.000447 33.588272 54.69 , 114.000348 33.588287 54.73 , 114.000245 33.588305 55.26 , 114.000153 33.588305 55.3)'::geometry,
                             ARRAY['2010-01-01 11:30'::timestamp, '2010-01-01 11:31', '2010-01-01 11:32', '2010-01-01 11:33','2010-01-01 11:34','2010-01-01 11:35'], NULL) a,
           ST_makeTrajectory('STPOINT', 'LINESTRINGZ(114.000529 33.588163 54.87 , 114.000535 33.578235 54.85 , 114.000447 33.578272 54.69 , 114.000348 33.578287 54.73 , 114.000245 33.578305 55.26 , 114.000163 33.588305 55.3)'::geometry,
                             ARRAY['2010-01-01 11:29:58'::timestamp, '2010-01-01 11:31:02', '2010-01-01 11:33', '2010-01-01 11:33:09','2010-01-01 11:34','2010-01-01 11:34:30'], NULL) b)
Select st_LCSSubDistance(a, b, 100) from traj;

st_lcssubdistance 
------------------------
 0.66666666666666666667 
 (1 row)

 With traj AS (
    Select ST_makeTrajectory('STPOINT', 'LINESTRINGZ(114.000528 33.588163 54.87 , 114.000535 33.588235 54.85 , 114.000447 33.588272 54.69 , 114.000348 33.588287 54.73 , 114.000245 33.588305 55.26 , 114.000153 33.588305 55.3)'::geometry,
                             ARRAY['2010-01-01 11:30'::timestamp, '2010-01-01 11:31', '2010-01-01 11:32', '2010-01-01 11:33','2010-01-01 11:34','2010-01-01 11:35'], NULL) a,
           ST_makeTrajectory('STPOINT', 'LINESTRINGZ(114.000529 33.588163 54.87 , 114.000535 33.578235 54.85 , 114.000447 33.578272 54.69 , 114.000348 33.578287 54.73 , 114.000245 33.578305 55.26 , 114.000163 33.588305 55.3)'::geometry,
                             ARRAY['2010-01-01 11:29:58'::timestamp, '2010-01-01 11:31:02', '2010-01-01 11:33', '2010-01-01 11:33:09','2010-01-01 11:34','2010-01-01 11:34:30'], NULL) b)
Select st_LCSSubDistance(a, b, 100, interval '30 seconds') from traj;
st_lcssubdistance 
-------------------
0.666666666666667
(1 row)