概述

查询指定终端在某时段内的移动轨迹;
由于终端定位常常存在定位不准、定位失败、定位精度不高等情况,轨迹云提供了包含轨迹去噪、抽稀、绑路、补偿等一系列优化策略,尽可能还原真实轨迹。 在轨迹优化查询基础上,计算整段轨迹里程。

轨迹查询/优化

请求URL

URL:https://apis.map.qq.com/tracks/trace/search
Method:GET


请求参数

参数名 必填 说明 示例
key 开发密钥(Key) key=xxx
service_id 服务id,要添加终端的轨迹服务id,需验证轨迹服务是否存在 service_id=xxx
entity_id 终端id entity_id=xxx
start_time 开始时间戳,单位:秒 start_time=946656000
end_time 结束时间戳,单位:秒 ,距离开始时间不能超过24小时 end_time=946742399
get_fields 是否返回全部字段
1[默认]返回全部字段(包括距离、耗时和轨迹)
2只返回距离和耗时(不返回轨迹)
get_fields=1
optimize 是否返回优化轨迹,
0 返回原始轨迹
1 [默认]返回优化轨迹
optimize=0
mode 优化方式,目前支持:
driving [默认]驾车方式
mode=driving
denoising 去噪
0 不去噪
1 [默认]去噪
denoising=0
accuracy 精度过滤,单位:米,精度大于此值时将被过滤 accuracy=50
snaptoroads 是否绑路,
0 不绑路
1 [默认]绑路
snaptoroads=1
compression 抽稀,0-5档,0为不抽稀,1到5档数值越大,抽稀粒度越大 compression=3
supplement 是否补偿:
0 不补偿
1 [默认]补偿
supplement=0
page_next 下页参数 page_next=xxx

响应结果

名称 类型 是否必须 说明
status string 状态码,0代表成功,其他为失败
message string 对status值的描述
request_id string 请求ID,用于问题排查
result object 返回结果
count number 终端数量
distance double 轨迹距离,单位:米
duration number 轨迹耗时,单位:秒
page_next number 下页页码,page_next将为空""时代表翻到了最后一页
track array 轨迹数组
- object 轨迹对象
lat double 纬度
lng double 经度
loctime number 定位时间戳,单位:秒
speed nubmer 速度,单位:千米/小时
direction nubmer 方向
altitude nubmer 高度
accuracy nubmer 定位精度,单位:米
type nubmer 轨迹点类型:0原始点,1优化点,2补偿点
trace_fields object 轨迹自定义字段
trace_field string/number 轨迹自定义字段信息,以实际为准
注:优化轨迹点自定义字段非必反

响应示例

{
    "status": 0,
    "message": "OK",
    "request_id": "35c6340f-1eb4-4743-b670-91951f3e5f2d-11ef7fc0bd71238a",
    "result": {
        "count": 1,
        "distance": 0,
        "duration": 0,
        "page_next": "",
        "track": [
            {
                "lat": 40.048468,
                "lng": 116.281433,
                "loctime": 1652338342,
                "accuracy": 40,
                "direction": 0,
                "speed": 0,
                "altitude": 10,
                "trace_fields": {
                    "number": 3
                },
                "type": 1
            }
        ]
    }
}

这篇文章对您解决问题是否有帮助?

已解决
未解决