WGS-84: GPS坐标系,国际标准,GPS模块使用。
GCJ-02: 火星坐标系,国测局坐标系,谷歌、高德、腾讯等使用。
BD-09: 百度坐标系,百度地图使用。
GCJ-02 转WGS-84公式:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import requests
import math
key = 'your key here' # 这里填写你的百度开放平台的key
x_pi = 3.14159265358979324 * 3000.0 / 180.0
pi = 3.1415926535897932384626 # π
a = 6378245.0 # 长半轴
ee = 0.00669342162296594323 # 扁率
def geocode(address):
"""
利用百度geocoding服务解析地址获取位置坐标
:param address:需要解析的地址
:return:
"""
geocoding = {'s': 'rsv3',