gpt4 book ai didi

python - 按道路名称交叉点进行地理编码

转载 作者:太空宇宙 更新时间:2023-11-03 20:46:16 25 4
gpt4 key购买 nike

我正在尝试获取道路交叉口的坐标,类似于在 Google map 中输入“1100 N & 300 W”,但给出的表格包含数万对。有谁知道支持这种类型搜索的地理定位模块?

我正在测试 geopy,它可以轻松定位一条道路,甚至包括按区域(即城市或县)限制搜索的选项,但在多次尝试更改我的测试交叉口措辞后仍然无法超越定位单个道路。

我尝试简单地将道路名称更改为更具描述性,即 CR 1100 N 和 CR 300 W...W CR 1100 N 和 N CR 300 W,但包含 CR 实际上会完全引发错误。

这是我到目前为止所拥有的......

from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="agent", format_string="%s, Madison County, IN")
location = geolocator.geocode("1100 N & 300 W")
print(location.address)
print(location.latitude)
print(location.longitude)

结果:

地址:North 300 West, Anderson, Madison County, Indiana, 46011, USA

纬度:40.142406经度:-85.728747

预计纬度:40.262935预期长度:-85.728308

最佳答案

尝试:https://geocoder.ca/1100%20N%20&%20300%20W%20ALEXANDRIA,%20IN

这个十字街位置。 (1100 N & 300 W 亚历山大) 40.262950, -85.72831

也可以是 JSON:https://geocoder.ca/1100%20N%20&%20300%20W%20ALEXANDRIA,%20IN?json=1

{ "standard": { "staddress": "N & 300", "stnumber": "1100", "postal": "46063", "street1": "1100 N ", "city": "亚历山大", "prov": "IN", "street2": "300 W ", "confidence": "0.8"}, "longt": "-85.728310", "TimeZone": "美国/印第安纳州/印第安纳波利斯", "区号”:“765”,“latt”:“40.262950”}

关于python - 按道路名称交叉点进行地理编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56581325/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com