python - 为什么在正确给出坐标后我没有得到实际位置?
问题描述
import reverse_geocoder as rc
import pprint
def locator():
lat = float(input("\nEnter your lattitude co-ordinates: "))
lon = float(input("Enter your longitude co-ordinates: "))
locations = (lat, lon)
location = rc.search(locations)
print("\n")
pprint.pprint(location)
if __name__ == "__main__":
locator()
解决方案
Lat,Lon 坐标有一个精确的比例。您需要在逗号后至少有 4-5 位数字才能获得米/英尺的精确位置。我从您的问题中猜测,这可能是由于一个四舍五入的数字。
例如(慕尼黑火车站):
48.139382, 11.559296
更改数字后的第一个数字将使我在路上移动几公里。
如果这不能提供答案,您能否提供一个您正在使用的坐标示例?
推荐阅读
- python - 如何在python中的数据集的两个不同列中找到相同值的匹配
- amazon-vpc - 同一安全组中的实例能否以任何方式相互通信
- html - html DOM的Javascript语音控制
- java - 实现具有 @query 注释的现有接口
- python - Python(使用替换替换来自不同列的多个值)
- python - 用Python中另一个列表中的项目替换满足某些条件的列表元素
- python - 为什么通过 Python `requests` 发出的请求比在 Postman 中花费的时间几乎长 7 倍?
- python - 尝试我们 str.contains 和布尔掩码,但仅适用于 Pandas 中的单个值
- python - Python脚本替换谷歌表中的路径变量
- javascript - oninput 可以替代 onchange 和 onpaste 吗?