GpsAnalyse.java
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.bsth.data.gpsdata.analyse;
import com.bsth.data.gpsdata.GpsEntity;
import com.vividsolutions.jts.geom.GeometryFactory;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* 分析gps状态信息
* Created by panzhao on 2016/12/23.
*/
public class GpsAnalyse {
//线程池
ExecutorService threadPool = Executors.newFixedThreadPool(50);
private static GeometryFactory geometryFactory = new GeometryFactory();
public void start(GpsEntity gps){
threadPool.execute(new ArrivalMatchThread(gps));
}
public class ArrivalMatchThread implements Runnable{
private GpsEntity gps;
public ArrivalMatchThread(GpsEntity gps){
this.gps = gps;
}
@Override
public void run() {
//CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm());
//站内还是站外
//Point p = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
/*if(queue == null){
//首个GPS点
queue = new CircleQueue<>(CACHE_SIZE);
queue.add(gps);
}*/
}
}
}