Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python版地理编码的查询链接有误 #33

Open
git190 opened this issue Oct 31, 2023 · 0 comments
Open

python版地理编码的查询链接有误 #33

git190 opened this issue Oct 31, 2023 · 0 comments

Comments

@git190
Copy link

git190 commented Oct 31, 2023

原链接为:
geocoding = {'s': 'rsv3', 'key': self.api_key, 'city': '全国', 'address': address} geocoding = urllib.parse.urlencode(geocoding) ret = urllib.request.urlopen("%s?%s" % ("http://restapi.amap.com/v3/geocode/geo", geocoding))
(举例:[http://restapi.amap.com/v3/geocode/geos=rsv3&key=xxx&city=%广州&address=%君紫花园)]
查询结果为:
{ "status": "0",
"info": "INVALID_USER_KEY",
"infocode": "10001"}

正确链接为:[http://restapi.amap.com/v3/geocode/geo?key=xxx&city=%广州&address=%君紫花园)]
geocoding = {'key': self.api_key, 'city': city, 'address': address} geocoding = urllib.parse.urlencode(geocoding) ret = urllib.request.urlopen("%s?%s" % ("http://restapi.amap.com/v3/geocode/geo?", geocoding))
查询结果为:
{
"status": "1",
"info": "OK",
"infocode": "10000",
"count": "1",
"geocodes": [
{
"formatted_address": "广东省广州市天河区君紫花园",
"country": "中国",
"province": "广东省",
"citycode": "020",
"city": "广州市",
"district": "天河区",
"township": [],
"neighborhood": {
"name": [],
"type": []
},
"building": {
"name": [],
"type": []
},
"adcode": "440106",
"street": [],
"number": [],
"location": "113.344832,23.127699",
"level": "兴趣点"
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant