删除无用方法,两点间距计算修改
This commit is contained in:
@@ -64,12 +64,4 @@ public class RealTimeProviderImp implements RealTimeProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.calculateLineDistance(p1, p2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,12 +35,5 @@ public interface RealTimeProvider {
|
||||
* 发送消息,由外部传入
|
||||
*/
|
||||
List<CloudLocationInfo> getLocationMsg();
|
||||
/**
|
||||
* 计算两点之间的距离
|
||||
*
|
||||
* @param p1
|
||||
* @param p2
|
||||
* @return
|
||||
*/
|
||||
float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.realtime.core;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.realtime.Imp.RealTimeProviderImp;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.realtime.util.LocationParseUtil;
|
||||
@@ -60,7 +61,7 @@ public class SimpleLocationCorrectStrategy {
|
||||
try {
|
||||
float targetDistance =
|
||||
(float) (lastLocation.getSpeed() * (SystemClock.elapsedRealtime() - anchorTime) / 1000) + TARGET_DISTANCE_DEVIATION;
|
||||
float distance = RealTimeProviderImp.getInstance().calculateLineDistance(LocationParseUtil.cloudLocationToMogoLatLng(lastLocation), LocationParseUtil.cloudLocationToMogoLatLng(info));
|
||||
float distance = CoordinateUtils.calculateLineDistance(lastLocation.getLon(),lastLocation.getLat(),info.getLon(),info.getLat());
|
||||
Logger.d(TAG,
|
||||
"准备计算{ lastInfo: " + lastLocation.print() + " info: " + info.print() + " targetDistance: " + targetDistance + " distance : " + distance + "}");
|
||||
|
||||
@@ -121,7 +122,7 @@ public class SimpleLocationCorrectStrategy {
|
||||
try {
|
||||
float targetDistance =
|
||||
(float) (lastLocation.getSpeed() * (SystemClock.elapsedRealtime() - anchorTime) / 1000) + TARGET_DISTANCE_DEVIATION;
|
||||
float distance = RealTimeProviderImp.getInstance().calculateLineDistance(LocationParseUtil.cloudLocationToMogoLatLng(lastLocation), LocationParseUtil.cloudLocationToMogoLatLng(info));
|
||||
float distance = CoordinateUtils.calculateLineDistance(lastLocation.getLon(),lastLocation.getLat(),info.getLon(),info.getLat());
|
||||
Logger.d(TAG,
|
||||
"异常定位点\n准备计算{ lastInfo: " + lastLocation.print() + " info: " + info.print() + " targetDistance: " + targetDistance + " distance : " + distance + "}");
|
||||
// 按照上一个点的方向和速度,计算下一个点的位置,下一个点除坐标点外,其余数据与上一个点相同
|
||||
|
||||
Reference in New Issue
Block a user