Python-百度经纬度转高德经纬度

Posted 短毛兔

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python-百度经纬度转高德经纬度相关的知识,希望对你有一定的参考价值。

 

import math
def bdToGaoDe(lon,lat):
    """
    百度坐标转高德坐标
    :param lon:
    :param lat:
    :return:
    """
    PI = 3.14159265358979324 * 3000.0 / 180.0
    x = lon - 0.0065
    y = lat - 0.006
    z = math.sqrt(x * x + y * y) - 0.00002 * math.sin(y * PI)
    theta = math.atan2(y, x) - 0.000003 * math.cos(x * PI)
    lon = z * math.cos(theta)
    lat = z * math.sin(theta)
    return lon,lat

 

以上是关于Python-百度经纬度转高德经纬度的主要内容,如果未能解决你的问题,请参考以下文章