首页 > 解决方案 > 为什么在正确给出坐标后我没有得到实际位置?

问题描述

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()

标签: pythonpython-3.xlocation

解决方案


Lat,Lon 坐标有一个精确的比例。您需要在逗号后至少有 4-5 位数字才能获得米/英尺的精确位置。我从您的问题中猜测,这可能是由于一个四舍五入的数字。

例如(慕尼黑火车站):

48.139382, 11.559296

更改数字后的第一个数字将使我在路上移动几公里。

如果这不能提供答案,您能否提供一个您正在使用的坐标示例?


推荐阅读