[m1]
[select sation]
This commit is contained in:
@@ -704,13 +704,29 @@ object CharterPassengerModel {
|
||||
siteInfo.GcjLon!!,
|
||||
siteInfo.GcjLat!!
|
||||
)
|
||||
// 距离 index 点小于30m
|
||||
// 仅计算 小于30m的下个坐标和下下个坐标
|
||||
if (calculateLineDistance < CharterPassengerConst.MIN_DISTANCE_STATION) {
|
||||
return if (index + 1 <= data.size - 1) {
|
||||
if (index + 1 <= data.size - 1) {
|
||||
// <可用站点标,是否靠近>
|
||||
Pair(index + 1, true)
|
||||
val calculateLineDistanceNext = CoordinateUtils.calculateLineDistance(
|
||||
currentInfo.longitude,
|
||||
currentInfo.latitude,
|
||||
data[index+1].GcjLon!!,
|
||||
data[index+1].GcjLat!!
|
||||
)
|
||||
if(calculateLineDistanceNext<CharterPassengerConst.MIN_DISTANCE_STATION){
|
||||
if (index + 2 <= data.size - 1) {
|
||||
return Pair(index + 2, true)// 下下个站点
|
||||
}else{
|
||||
return Pair(-1, true)// 距离最后一个站点小于30m
|
||||
}
|
||||
}else {
|
||||
return Pair(index + 1, true)// 下个站点
|
||||
}
|
||||
} else {
|
||||
// 所有点都不可用用
|
||||
Pair(-1, true)// 距离最后一个站点小于30m
|
||||
return Pair(-1, true)// 距离最后一个站点小于30m
|
||||
}
|
||||
}
|
||||
distanceMap.put(calculateLineDistance, index)
|
||||
@@ -729,6 +745,11 @@ object CharterPassengerModel {
|
||||
return Pair(1, false)
|
||||
}
|
||||
mLocation?.let {
|
||||
// 仅计算 距离最近的站点middle 附近5个坐标的夹角
|
||||
// middle middle-1
|
||||
// middle middle+1
|
||||
// middle-1 middle-2
|
||||
// middle+1 middle+2
|
||||
if(middle-1>=0) {
|
||||
val degree = CoordinateCalculateRouteUtil.getDegree(
|
||||
it.longitude, it.latitude,
|
||||
|
||||
Reference in New Issue
Block a user