浏览器版本低!无法浏览完整内容,建议升级或更换浏览器。
简介

鹰眼轨迹分析类接口提供停留点分析和驾驶行为分析功能:

1. 停留点分析接口:一段轨迹中有多少个停留点、停留在何处、停留了多久
2. 驾驶行为分析:一段轨迹中有多少个超速点、急加/减速点、急转弯点,其中超速点功能支持依据百度地图路网实际道路限速计算,也支持开发者设置固定的限速值

注意: 如使用轨迹分析相关接口,轨迹点上传时请务必同步上传speed(速度)和direction(方向)字段,否则该接口将不进行分析计算。鹰眼SDK在GPS定位下会自动采集这些数据。

接口列表
模块接口名称功能说明
analysisstaypoint停留点分析
drivingbehavior驾驶行为分析
坐标系说明

目前中国主要有以下三种坐标系:

WGS84:为一种大地坐标系,也是目前广泛使用的GPS全球卫星定位系统使用的坐标系
GCJ02:是由中国国家测绘局制订的地理信息系统的坐标系统。由WGS84坐标系经加密后的坐标系
BD09:为百度坐标系,在GCJ02坐标系基础上再次加密。其中bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托米制坐标

非中国地区地图,统一使用WGS84坐标

接口说明
staypoint——停留点查询

查询entity在指定时间段内的停留点。停留点判断规则为:在stay_radius半径范围内,滞留stay_time以上,被认为是一次停留,将取一个代表性坐标作为停留点,其中 stay_radius 默认为20米,stay_time 默认为 600秒。

请求URL

https://yingyan.baidu.com/api/v3/analysis/staypoint
//GET请求

请求参数
参数名称字段含义数据类型是否必填备注
ak

用户的AK

string
service_id

service的ID,service 的唯一标识

int在轨迹管理台创建鹰眼服务时,系统返回的 service_id
entity_name

entity唯一标识

string(0-128)
start_time

开始时间

UNIX时间戳
end_time

结束时间

UNIX时间戳
stay_time

停留时间

int单位:秒,默认值:600。该字段用于设置停留点判断规则,即若系统判断在半径为stay_radius的圆形范围内停留时间超过stay_time,则被认为是一次停留
stay_radius

停留半径

int单位:米,取值范围:[1,500],默认值:20。该字段用于设置停留点判断规则,即若系统判断在半径为stay_radius的圆形范围内停留时间超过stay_time,则被认为是一次停留
process_option

纠偏选项

string(0-128)

默认值为:
need_mapmatch=0,transport_mode=driving
取值规则为:
1.绑路,示例:
need_mapmatch=0:不绑路
need_mapmatch=1:绑路
2.交通方式,鹰眼将根据不同交通工具选择不同的纠偏策略,目前支持驾车、骑行和步行,示例:
transport_mode=driving transport_mode=riding transport_mode=walking

coord_type_output

返回的坐标类型

string

默认值:bd09ll
该字段用于控制返回结果中的坐标类型。可选值为:
gcj02:国测局加密坐标
bd09ll:百度经纬度坐标
该参数仅对国内(包含港、澳、台)轨迹有效,海外区域轨迹均返回 wgs84坐标系

sn

用户的权限签名,若用户所用AK的校验方式为SN校验时该参数必须。SN计算方法

string
返回参数
参数名字段含义类型备注
status状态码int返回状态,0为成功
message响应信息string对status的中文描述
staypoint_num停留次数int本段行程中停留次数
stay_points停留记录列表array数组中每个元素代表一次停留,记录一个停留点坐标
start_time停留开始时间UNIX时间戳
end_time停留结束时间UNIX时间戳
duration停留时长int单位:秒
stay_point停留点dict
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
请求示例
https://yingyan.baidu.com/api/v3/analysis/staypoint?ak=用户的'''AK'''&service_id=用户的service_id&entity_name=car_plate&start_time=1467734400&end_time=1467817200&stay_time=300
返回示例
{
"status": 0,
"message": "成功",
staypoint_num: 3,
stay_points: [
{
start_time: 1464164829,
end_time: 1464166832,
duration: 2003,
stay_point: {
longitude: 113.22167932597,
latitude: 23.411219209009,
coord_type: 3
}
},
{
start_time: 1464170138,
end_time: 1464171664,
duration: 1526,
stay_point: {
longitude: 113.20923398543,
latitude: 23.411707425027,
coord_type: 3
}
},
{
start_time: 1464172067,
end_time: 1464172952,
duration: 885,
stay_point: {
longitude: 113.207836,
latitude: 23.40664,
coord_type: 3
}
}
]
}
drivingbehavior——驾驶行为分析

查询entity在指定时间段内的驾驶行为,返回以下分析结果:
1. 总体信息:起终点信息、里程、耗时、平均速度、最高速度
2. 异常信息:超速、急加速、急刹车、急转弯

请求URL

https://yingyan.baidu.com/api/v3/analysis/drivingbehavior
//GET 请求

请求参数
参数名称字段含义数据类型是否必填备注
ak

用户的AK,授权使用

string
service_id

service的ID,service 的唯一标识

intservice 的唯一标识。在轨迹管理台创建鹰眼服务时,系统返回的 service_id
entity_name

entity唯一标识

string
start_time

开始时间

UNIX时间戳
end_time

结束时间

UNIX时间戳结束时间需大于开始时间,但不可大于超过24小时。为提升响应速度,同时避免轨迹点过多造成请求超时(3s)失败,建议缩短每次请求的时间区间,将一天拆分成多个时间段,对结果进行拼接
speeding_threshold

固定限速值

double

默认值:0
取值规则:
0:根据百度地图道路限速数据计算超速点 其他数值:以设置的数值为阈值,轨迹点速度超过该值则认为是超速;
示例: speeding_threshold=0,以道路限速数据计算 speeding_threshold=80,限速值为80km/h

harsh_acceleration_threshold

急加速的加速度阈值

double

默认值:1.67,单位:m/s^2,仅支持正数

harsh_breaking_threshold

急减速的加速度阈值

double

默认值:-1.67,单位:m/s^2,仅支持负数

harsh_steering_threshold

急转弯的向心加速度阈值

double

默认值:5,单位:m/s^2,仅支持正数

process_option

纠偏选项,用于控制返回坐标的纠偏处理方式,不填则按默认纠偏方式处理

string(0-128)

默认值为:
need_mapmatch=0,transport_mode=driving
取值规则为:
1.绑路,示例:
need_mapmatch=0:不绑路
need_mapmatch=1:绑路
2.交通方式,鹰眼将根据不同交通工具选择不同的纠偏策略,目前支持驾车、骑行和步行,示例:
transport_mode=driving transport_mode=riding transport_mode=walking

coord_type_output

返回的坐标类型

string

默认值:bd09ll
该字段用于控制返回结果中的坐标类型。可选值为:
gcj02:国测局加密坐标
bd09ll:百度经纬度坐标
该参数仅对国内(包含港、澳、台)轨迹有效,海外区域轨迹均返回 wgs84坐标系

sn

用户的权限签名,若用户所用AK的校验方式为SN校验时该参数必须。SN计算方法

string
返回值
参数名称字段含义字段类型备注
status状态码int返回状态,0为成功
message响应信息string对status的中文描述
distance轨迹里程double单位:米
duration行程耗时int单位:秒
average_speed平均时速double单位:km/h
max_speed最高时速double单位:km/h
speeding_num超速次数int
harsh_acceleration_num 急加速次数int
harsh_breaking_num急刹车次数int
harsh_steering_num急转弯次数int
harsh_steering_num急转弯次数int
start_point起点信息
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
loc_time定位时间UNIX时间戳
address起点地址
end_point终点信息
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
loc_time定位时间UNIX时间戳
address起点地址
speeding超速记录集合array超速记录集合是一个数组,数组中的每一项代表一次超速记录
超速记录array
speeding_distance超速里程double单位:米。本次超速的里程
speeding_points超速点array一条超速记录中的超速起点或终点
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
loc_time定位时间UNIX时间戳
actual_speed实际行驶时速double单位:km/h
limit_speed所在道路限定最高时速double单位:km/h
harsh_acceleration急加速记录集合
急加速记录array
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
loc_time定位时间UNIX时间戳
acceleration实际加速度double单位:m/s^2
initial_speed加速前时速double单位:km/h
end_speed加速后时速double单位:km/h
harsh_breaking急刹车记录集合
急刹车记录array
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
loc_time定位时间UNIX时间戳
acceleration实际加速度double单位:m/s^2
initial_speed刹车前时速double单位:km/h
end_speed刹车后时速double单位:km/h
harsh_steering急转弯记录集合
急转弯记录array
longitude经度double
latitude纬度double
coord_type坐标类型string该字段仅在海外区域时返回,返回值为:wgs84。当坐标位于国内(含港、澳、台)时,返回坐标类型与请求参数 coord_type_output 所设一致,因此不再返回该字段
loc_time定位时间UNIX时间戳
centripetal_acceleration向心加速度double单位:m/s^2
turn_type转向类型string取值范围:unknow(方向未知),left(左转),right(右转)
speed转向时速double单位:km/h
请求示例
https://yingyan.baidu.com/api/v3/analysis/drivingbehavior?ak=<用户的'''AK>'''&service_id=用户的service_id&entity_name=car_plate&start_time=1464105600&end_time=1464191940&speeding_threshold=80
返回示例
{
status: 0,
message: "成功",
distance: 79707.90026776,
duration: 38441,
average_speed: 7.4646455858052,
max_speed: 56.7,
start_point: {
longitude: 113.2075,
latitude: 23.40675,
coord_type: "bd09ll",
loc_time: 1464134680,
address: "新景豪苑内,新凤凰酒店-休闲会所附近9米"
},
end_point: {
longitude: 113.208055,
latitude: 23.406561,
coord_type: "bd09ll",
loc_time: 1464173121,
address: "盛业行东南49米"
},
speeding_num: 2,
harsh_acceleration_num: 1,
harsh_breaking_num: 1,
harsh_steering_num: 1,
speeding: [
{
speeding_distance: 59.189285867195,
speeding_points: [
{
longitude: 113.20710875909,
latitude: 23.39908060312,
coord_type: "bd09ll",
loc_time: 1464138828,
actual_speed: 87.5,
limit_speed: 60
},
{
longitude: 113.20697265531,
latitude: 23.399597906861,
coord_type: "bd09ll",
loc_time: 1464138843,
actual_speed: 108.9,
limit_speed: 80
}
]
},
{
speeding_distance: 989.53701539415,
speeding_points: [
{
longitude: 113.21499929275,
latitude: 23.413317284437,
coord_type: "bd09ll",
loc_time: 1464141367,
actual_speed: 32.4,
limit_speed: 15
},
{
longitude: 113.21692508544,
latitude: 23.408488134541,
coord_type: "bd09ll",
loc_time: 1464141794,
actual_speed: 16.2,
limit_speed: 15
}
]
}
],
harsh_acceleration: [
{
longitude: 113.21725316042,
latitude: 23.412958154234,
coord_type: "bd09ll",
loc_time: 1464143029,
acceleration: 2.75,
initial_speed: 0,
end_speed: 19.8
}
],
harsh_breaking: [
{
longitude: 113.2149819651,
latitude: 23.411143610036,
coord_type: "bd09ll",
loc_time: 1464141265,
acceleration: -2.25,
initial_speed: 34.2,
end_speed: 26.1
}
],
harsh_steering: [
{
longitude: 113.2399844062,
latitude: 23.415216724914,
coord_type: "bd09ll",
loc_time: 1464158589,
centripetal_acceleration: 5.0324216823668,
turn_type: "left",
speed: 36.44
}
]
}

上一篇

轨迹查询和纠偏

下一篇

经验行为分析

本篇文章对您是否有帮助?