Trajectory
轨迹类TrajectoryPoints:
- 初始化
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gps_points_df
|
DataFrame
|
定位数据表 |
required |
time_format
|
str
|
时间列字符串格式模板 |
'%Y-%m-%d %H:%M:%S'
|
time_unit
|
str
|
时间单位 |
's'
|
plain_crs
|
str
|
平面投影坐标系 |
'EPSG:3857'
|
Source code in src/gotrackit/gps/Trajectory.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
类方法 - dense
- 增密:对定位点进行线性增密
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dense_interval
|
float
|
增密阈值(米), 当相邻GPS点的球面距离L超过dense_interval即进行增密, 进行 int(L / dense_interval) + 1 等分加密 |
120.0
|
Returns:
| Type | Description |
|---|---|
|
self |
Source code in src/gotrackit/gps/LocGps.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
类方法 - lower_frequency
- 降频:对定位数据进行降频采样
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lower_n
|
int
|
降频倍数 |
2
|
multi_agents
|
bool
|
|
True
|
Returns:
| Type | Description |
|---|---|
|
self |
Source code in src/gotrackit/gps/LocGps.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
类方法 - kf_smooth:
- 使用卡尔曼滤波对轨迹数据进行平滑
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_deviation
|
list or float
|
过程噪声的标准差 |
0.01
|
o_deviation
|
list or float
|
观测噪声的标准差, 该值越小, 平滑后的结果就越接近原轨迹 |
0.1
|
Returns:
| Type | Description |
|---|---|
|
self |
Source code in src/gotrackit/gps/LocGps.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | |
类方法 - rolling_average:
- 滑动窗口:使用滑动窗口对定位数据进行平滑, 只要启用了该操作, 那么user_field_list自动失效
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rolling_window
|
int
|
滑动窗口大小 |
2
|
multi_agents
|
bool
|
|
True
|
Returns:
| Type | Description |
|---|---|
|
self |
Source code in src/gotrackit/gps/LocGps.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
类方法 - del_dwell_points:
- 停留点识别:基于距离阈值对停留点进行识别并且进行删除
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dwell_l_length
|
float
|
停留点识别距离阈值(米) |
5.0
|
dwell_n
|
int
|
大于等于0的整数, 超过连续dwell_n + 1个相邻GPS点的距离小于dwell_l_length,那么这一组点就会被识别为停留点 |
2
|
Returns:
| Type | Description |
|---|---|
|
self |
Source code in src/gotrackit/gps/LocGps.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | |
类方法 - simplify_trajectory:
- 简化轨迹:利用道格拉斯-普克算法对轨迹进行抽稀简化
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
l_threshold
|
float
|
抽稀阈值(米) |
5.0
|
Returns:
| Type | Description |
|---|---|
|
self |
Source code in src/gotrackit/gps/LocGps.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 | |
类方法 - trajectory_data
- 获取轨迹:获取处理后的轨迹数据(支持DataFrame和GeoDataFrame)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
export_crs
|
str
|
输出结果的坐标系 |
'EPSG:4326'
|
_type
|
str
|
输出结果的类型, gdf或者df |
'gdf'
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame or DataFrame
|
轨迹数据 |
Source code in src/gotrackit/gps/LocGps.py
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 | |
TrajectoryPoints类方法 - export_html
导出HTML:将处理后的轨迹导出为HTML,可动态展示处理前后的轨迹
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_fldr
|
str
|
存储目录 |
'./'
|
file_name
|
str
|
文件名称 |
'trajectory'
|
radius
|
float
|
点的半径大小 |
10.0
|
Returns:
| Type | Description |
|---|---|
|
None |
Source code in src/gotrackit/gps/Trajectory.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |