【发布时间】:2019-10-21 20:19:36
【问题描述】:
我正在尝试将加拿大邮政编码转换为经纬度坐标,但 geopy 将它们返回为无或在不同国家/地区的某个地方
postal_code = "A1B 2C3" #<-- in this format
location = geolocator.geocode(postal_code)
print(location.latitude, location.longitude)
输出
AttributeError: 'NoneType' object has no attribute 'latitude'
或者
一些随机地址
【问题讨论】: