【问题标题】:Why I am not getting actuall location after given by co-ordinates correctly?为什么在正确给出坐标后我没有得到实际位置?
【发布时间】:2020-04-20 08:45:47
【问题描述】:
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()

【问题讨论】:

  • 输入?期望的输出?
  • 当我输入我的两个坐标时,它给了我一个靠近我的位置。实际上不是那么近(距给定位置的正确坐标至少 100 公里的位置)。我想得到我正在寻找的位置。
  • 输入您的纬度坐标:23.506657 输入您的经度坐标:90.3443647 正在加载格式化的地理编码文件... [OrderedDict([('lat', '23.61352'), ('lon', '90.50298'), ('name', 'Narayanganj'), ('admin1', 'Dhaka'), ('admin2', ''), ('cc', 'BD')])]
  • 使用这些详细信息更新您的问题。

标签: python python-3.x location


【解决方案1】:

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

例如(慕尼黑火车站):

48.139382, 11.559296

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-06
    • 2013-08-19
    • 2017-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多