首页 > 编程知识 正文

python根据经纬度算距离 怎么输出,python地址转经纬度

时间:2023-05-05 19:09:46 阅读:244035 作者:890

import mathdef 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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。