import json
import math
import random
import re
import time
import requests
x_pi = 3.14159265358979324 * 3000.0 / 180.0
pi = 3.1415926535897932384626 # π
a = 6378245.0 # 长半轴
ee = 0.00669342162296594323 # 偏心率平方
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
}
# tmp_url = "https://m.amap.com/service/poi/batchbus.json?lineids=320100013579"
# 每条线路的GPS
# res = ret['data'][0]['item'][0]['coords']
# print(res)
# print(len(res))
def bd09_to_gcj02(bd_lon, bd_lat):
"""
百度坐标系(BD-09)转火星坐标系(GCJ-02)
百度——>谷歌、高德
:param bd_lat:百度坐标纬度
:param bd_lon:百度坐标经度
:return:转换后的坐标列表形式
"""
x = bd_lon - 0.0065
y = bd_lat - 0.006
z = math.sqrt(x * x + y * y) - 0.00002 * math.sin(y * x_pi)
theta = math.atan2(y, x) - 0.000003 * math.cos(x
GPS点与百度坐标,高德坐标之间的装换方法
最新推荐文章于 2024-09-15 22:41:50 发布

本文详细介绍了如何在GPS坐标、百度坐标和高德坐标之间进行转换,包括坐标系统的差异以及具体的转换算法,帮助开发者在地图应用中准确处理定位数据。
最低0.47元/天 解锁文章
3343

被折叠的 条评论
为什么被折叠?



