six_002
This commit is contained in:
+45
-45
@@ -95,14 +95,14 @@ class wei地图工具:
|
||||
print(res_data.json())
|
||||
res_json = res_data.json() # type: dict
|
||||
d = {
|
||||
'status': 0,
|
||||
'message': 'Success',
|
||||
'request_id': '9435209f1ee84219ae7826e65f577331',
|
||||
'result': {
|
||||
'rows': [{
|
||||
'elements': [{
|
||||
'distance': 3550, # 起点到终点的距离,单位:米
|
||||
'duration': 651, # 表示从起点到终点的结合路况的时间,秒为单位注:步行/骑行方式(不计算耗时)以及起终点附近没有道路造成无法计算时,不返回本此节点
|
||||
"status": 0,
|
||||
"message": "Success",
|
||||
"request_id": "9435209f1ee84219ae7826e65f577331",
|
||||
"result": {
|
||||
"rows": [{
|
||||
"elements": [{
|
||||
"distance": 3550, # 起点到终点的距离,单位:米
|
||||
"duration": 651, # 表示从起点到终点的结合路况的时间,秒为单位注:步行/骑行方式(不计算耗时)以及起终点附近没有道路造成无法计算时,不返回本此节点
|
||||
}],
|
||||
}],
|
||||
},
|
||||
@@ -116,29 +116,29 @@ class wei地图工具:
|
||||
url = f"https://apis.map.qq.com/ws/geocoder/v1/?address={address}"
|
||||
res = requests.get(url=url, params={"key": cls.key}, )
|
||||
d = {
|
||||
'status': 0,
|
||||
'message': 'Success',
|
||||
'request_id': '9b049a3ff13c4ac3bda3bb5a9fe0c0a8',
|
||||
'result': {
|
||||
'title': '泰州海陵万达广场',
|
||||
'location': { # 解析到的坐标(GCJ02坐标系)
|
||||
'lng': 119.917068, # 经度
|
||||
'lat': 32.471578, # 纬度
|
||||
"status": 0,
|
||||
"message": "Success",
|
||||
"request_id": "9b049a3ff13c4ac3bda3bb5a9fe0c0a8",
|
||||
"result": {
|
||||
"title": "泰州海陵万达广场",
|
||||
"location": { # 解析到的坐标(GCJ02坐标系)
|
||||
"lng": 119.917068, # 经度
|
||||
"lat": 32.471578, # 纬度
|
||||
},
|
||||
'ad_info': { # 行政区划信息 object 是
|
||||
'adcode': '321202', # string 是 行政区划代码,规则详见:行政区划代码说明
|
||||
"ad_info": { # 行政区划信息 object 是
|
||||
"adcode": "321202", # string 是 行政区划代码,规则详见:行政区划代码说明
|
||||
},
|
||||
'address_components': {
|
||||
'province': '江苏省',
|
||||
'city': '泰州市',
|
||||
'district': '海陵区',
|
||||
'street': '济川东路',
|
||||
'street_number': '',
|
||||
"address_components": {
|
||||
"province": "江苏省",
|
||||
"city": "泰州市",
|
||||
"district": "海陵区",
|
||||
"street": "济川东路",
|
||||
"street_number": "",
|
||||
},
|
||||
'similarity': 0.99,
|
||||
'deviation': 1000,
|
||||
'reliability': 7, # 可信度参考:值范围 1 <低可信> - 10 <高可信>
|
||||
'level': 11, # 解析精度级别,分为11个级别,一般>=9即可采用(定位到点,精度较高) 也可根据实际业务需求自行调整,完整取值表见下文。
|
||||
"similarity": 0.99,
|
||||
"deviation": 1000,
|
||||
"reliability": 7, # 可信度参考:值范围 1 <低可信> - 10 <高可信>
|
||||
"level": 11, # 解析精度级别,分为11个级别,一般>=9即可采用(定位到点,精度较高) 也可根据实际业务需求自行调整,完整取值表见下文。
|
||||
},
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ class wei地图工具:
|
||||
def 经纬度转换为地址(cls, location):
|
||||
""""""
|
||||
pass
|
||||
url = f'https://apis.map.qq.com/ws/geocoder/v1/?location={location}'
|
||||
url = f"https://apis.map.qq.com/ws/geocoder/v1/?location={location}"
|
||||
res = requests.get(url=url, params={"key": cls.key}, )
|
||||
return res.json()
|
||||
|
||||
@@ -159,22 +159,22 @@ class wei地图工具:
|
||||
print(data)
|
||||
resData = pydash.omit(data, "request_id")
|
||||
d = {
|
||||
'status': 0,
|
||||
'message': 'Success',
|
||||
'request_id': '8805bff3303f42dd8a1cbcca3701cf63',
|
||||
'result': {
|
||||
'ip': '240e:3a3:b201:3f10:185c:efdb:c5b0:b95c',
|
||||
'location': {
|
||||
'lat': 32.49098,
|
||||
'lng': 119.91956,
|
||||
"status": 0,
|
||||
"message": "Success",
|
||||
"request_id": "8805bff3303f42dd8a1cbcca3701cf63",
|
||||
"result": {
|
||||
"ip": "240e:3a3:b201:3f10:185c:efdb:c5b0:b95c",
|
||||
"location": {
|
||||
"lat": 32.49098,
|
||||
"lng": 119.91956,
|
||||
},
|
||||
'ad_info': {
|
||||
'nation': '中国',
|
||||
'province': '江苏省',
|
||||
'city': '泰州市',
|
||||
'district': '海陵区',
|
||||
'adcode': 321202,
|
||||
'nation_code': 156,
|
||||
"ad_info": {
|
||||
"nation": "中国",
|
||||
"province": "江苏省",
|
||||
"city": "泰州市",
|
||||
"district": "海陵区",
|
||||
"adcode": 321202,
|
||||
"nation_code": 156,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -190,6 +190,6 @@ class wei地图工具:
|
||||
return resData
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
# wei地图工具.腾讯地图计算二点之间的距离(toData终点={"纬度": "30.80377", "经度": "104.151812"}, fromData起点={"纬度": "30.80377", "经度": "104.151812"})
|
||||
print(wei地图工具.ip地址转为地址(x_forwarded_for="119.84.150.100", ))
|
||||
|
||||
Reference in New Issue
Block a user