注:本文所用時(shí)間為14量車的總時(shí)間單位為秒掠抬。
一、對(duì)數(shù)據(jù)的簡(jiǎn)單分析
1.總數(shù)據(jù)量的統(tǒng)計(jì)
select count(*) as number from trajectory; #總數(shù)據(jù)條數(shù)為2千萬(wàn)條
image.png
2.查詢有多少量車
select count(distinct vme_id) from trajectory; #共有14量車```

#二校哎、農(nóng)機(jī)運(yùn)營(yíng)分析
1.查詢有多少軌跡點(diǎn)速度等于0(即休息時(shí)間)
select count(*) from trajectory where speed=0;```
image.png
休息時(shí)間占比為4540327/20249036=0.22
2.查詢平均作業(yè)深度(去除非作業(yè)數(shù)據(jù))
select avg(work_deep) from trajectory where work_deep>50;#作業(yè)平均深度為40
image.png
3.查詢作業(yè)時(shí)間
select count(*) from trajectory where work_deep>100 #輸出7712956;
select count(*) from trajectory where work_deep>200 #輸出7681255两波;
select count(*) from trajectory where work_deep>300 #輸出7490286;
select count(*) from trajectory where work_deep>350 #輸出6905956瞳步;
select count(*) from trajectory where work_deep>400 #輸出3478811;
image.png
以深度300以上為作業(yè):7490286/20249036=0.37
4.查詢速度
select max(speed) from trajectory; #最大數(shù)據(jù)27
select avg(speed) from trajectory; #平均速度3.2
select min(speed) from trajectory; #最小速度0
select speed , count(*) from trajectory group by speed;
image.png
橫坐標(biāo)為速度腰奋, 縱坐標(biāo)為軌跡點(diǎn)數(shù)目单起,速度為車輛的瞬時(shí)速度。
5.查詢作業(yè)深度
select work_deep, count(*) from trajectory group by work_deep;
image.png
6.其他
image.png
1表示速度為0(藍(lán)色)和速度非零的作業(yè)時(shí)間
2表示作業(yè)深度小于50(藍(lán)色)和作業(yè)深度大于50的作業(yè)時(shí)間
從途中可以看出非作業(yè)中很大一部分時(shí)間中農(nóng)機(jī)處于停息狀態(tài)約占22%.
三劣坊、基于時(shí)間的農(nóng)機(jī)軌跡分析
1.作業(yè)月份分析
select month(gps_time, count(*)) from trajectory group by month(gps_time);```

2.不同農(nóng)機(jī)運(yùn)營(yíng)時(shí)間分析
select vme_id ,count(*) from trajectory group by vme_id ; ```
image.png
3.不同農(nóng)機(jī)作業(yè)時(shí)間分析
select vme_id ,count(*) from trajectory where work_deep>50 group by vme_id ; ```

4.不同時(shí)間段作業(yè)分析
