1
This commit is contained in:
@@ -247,6 +247,19 @@ func BaiDuCoord2Gaode2(baiduCoordinat []string) []string {
|
||||
return gaoCoordinat
|
||||
}
|
||||
|
||||
// GaodeCoord2BaiDu 高德坐标转百度坐标
|
||||
func GaodeCoord2BaiDu(lng, lat float64) (float64, float64) {
|
||||
x := lng
|
||||
y := lat
|
||||
z := math.Sqrt(x*x+y*y) + 0.00002*math.Sin(y*math.Pi)
|
||||
theta := math.Atan2(y, x) + 0.000003*math.Cos(x*math.Pi)
|
||||
|
||||
bdLng := z*math.Cos(theta) + 0.0065
|
||||
bdLat := z*math.Sin(theta) + 0.006
|
||||
|
||||
return bdLng, bdLat
|
||||
}
|
||||
|
||||
// distance单位为米
|
||||
func ConvertDistanceToLogLat(lng, lat, distance, angle float64) (newLng, newLat float64) {
|
||||
oneDu := 111319.55 // 单位为米
|
||||
|
||||
Reference in New Issue
Block a user