测试:补 rond 合并冲突与 gpx 解析用例,删两处死代码
This commit is contained in:
@@ -125,26 +125,6 @@ func (t Track) LengthKm() float64 {
|
||||
return sum
|
||||
}
|
||||
|
||||
// BBox 返回 [minLon, minLat, maxLon, maxLat]。
|
||||
func (t Track) BBox() [4]float64 {
|
||||
b := [4]float64{180, 90, -180, -90}
|
||||
for _, p := range t.Points {
|
||||
if p.Lon < b[0] {
|
||||
b[0] = p.Lon
|
||||
}
|
||||
if p.Lat < b[1] {
|
||||
b[1] = p.Lat
|
||||
}
|
||||
if p.Lon > b[2] {
|
||||
b[2] = p.Lon
|
||||
}
|
||||
if p.Lat > b[3] {
|
||||
b[3] = p.Lat
|
||||
}
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func haversine(a, b Point) float64 {
|
||||
const r = 6371.0
|
||||
dLat := (b.Lat - a.Lat) * math.Pi / 180
|
||||
|
||||
Reference in New Issue
Block a user