91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

此為Python包,利用百度地圖API實現指定經緯度,返回相應的省市區等位置信息。

資源截圖

代碼片段和文件信息

#?-*-?coding:?utf-8?-*-
“““
Created?on?Mon?Aug??6?11:57:57?2018

@author:?Leon

根據百度地圖API,獲取給定經緯度的地點所在省市區信息
我所申請的百度AK(未做IP限制):YRGGPTIunajhbD9EPevI7i8ZCWWekEDs

“““

import?requests?as?_req

class?location:
????
????def?__init__(selflnglatak=‘YRGGPTIunajhbD9EPevI7i8ZCWWekEDs‘):
????????#?初始化變量,并通過在變量名前面加雙下劃線“__”,來使其成為私有變量,防止類外訪問
????????self.__lng=lng?
????????self.__lat=lat
????????self.__ak=ak
????????items?=?{‘location‘:?str(self.__lat)?+?‘‘?+?str(self.__lng)?‘ak‘:?self.__ak?‘output‘:?‘json‘}
????????res?=?_req.get(‘http://api.map.baidu.com/geocoder/v2/‘?params=items)
????????self.__result?=?res.json()

????def?country(self):
????????return?self.__result[‘result‘][‘addressComponent‘][‘country‘]
????
????def?province(self):
????????return?self.__result[‘result‘][‘addressComponent‘][‘province‘]
????
????def?city(self):
????????return?self.__result[‘result‘][‘addressComponent‘][‘city‘]
????????
????def?district(self):
????????return?self.__result[‘result‘][‘addressComponent‘][‘district‘]



?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????????0??2018-08-10?10:20??baidumapAPI\__init__.py
?????目錄???????????0??2018-08-24?10:21??baidumapAPI\__pycache__\
?????文件?????????163??2018-08-10?10:59??baidumapAPI\__pycache__\__init__.cpython-36.pyc
?????文件????????1595??2018-08-10?10:59??baidumapAPI\__pycache__\locatebyLatLng.cpython-36.pyc
?????文件????????1202??2018-08-10?10:48??baidumapAPI\locatebyLatLng.py
?????目錄???????????0??2018-08-24?10:21??baidumapAPI\

評論

共有 條評論