opt
This commit is contained in:
@@ -1055,16 +1055,20 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
&& !roadCache.getRoad().isEmpty() ) {
|
||||
start = System.currentTimeMillis();
|
||||
double matchedPoint[] = PointInterpolatorUtil.mergeToRoad( wgs[0], wgs[1], roadCache.getRoad() );
|
||||
double diff = CoordinateUtils.calculateLineDistance(lon, lat, roadCache.getLastLon(), roadCache.getLastLon());
|
||||
if ( (roadCache.getLastDistanceDiff() == 0 || roadCache.getLastDistanceDiff() > diff)) {
|
||||
roadCache.setLastDistanceDiff(diff);
|
||||
roadCacheMap.put(id, roadCache);
|
||||
Log.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
if(matchedPoint[2]<1) {
|
||||
double diff = CoordinateUtils.calculateLineDistance(lon, lat, roadCache.getLastLon(), roadCache.getLastLon());
|
||||
if ((roadCache.getLastDistanceDiff() == 0 || roadCache.getLastDistanceDiff() > diff)) {
|
||||
roadCache.setLastDistanceDiff(diff);
|
||||
roadCacheMap.put(id, roadCache);
|
||||
Log.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return matchedPoint;
|
||||
}
|
||||
roadCacheMap.put(id, null);
|
||||
Log.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK);
|
||||
}else{
|
||||
return matchedPoint;
|
||||
}
|
||||
roadCacheMap.put(id, null);
|
||||
Log.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user