为什么在地理编码时反向地理编码时,我没有获得任何价值,这给了我完全相同的纬度和经度呢?
我正在尝试使用反向地理编码来尝试找到州和城市。但是我没有得到某些纬度和纵向的任何结果。以下是科罗拉多州亚当斯州立大学的一个例子。我使用了研究所的名称和状态名称来获取lat and long。但是,当我使用相同的LAT和长时间反向地理编码时,结果我一无所获。如果我使用相同的nominatim(user_agent =“ myapp”),这两个为什么会发生,我该怎么办?
geolocator = Nominatim(user_agent="MyApp")
location = geolocator.geocode("Adams State University, Colorado")
Lat = location.latitude
Long = location.longitude
print('LAT: ',location.latitude)
print('LONG:', location.longitude)
LAT: 37.47480245
LONG: -105.8819230946304
geolocator = Nominatim(user_agent="MyApp")
location = geolocator.reverse("37.474802,-105.881923")
state = location.raw.get('address').get('State')
city = location.raw.get('address').get('City')
print('State: ',state)
print('City: ',city)
State: None
City: None
I'm trying to use reverse geocoding to try and find the state and city. But I am not getting any results for certain latitudes and longitudes. Given below is an example of Adams State University in Colorado. I used the Institute name and State name to get the Lat and Long. But when I use the same Lat and Long to reverse geocode the same I get None as the result. If I'm using the same Nominatim(user_agent="MyApp") for both why is this happening and what should I do?
geolocator = Nominatim(user_agent="MyApp")
location = geolocator.geocode("Adams State University, Colorado")
Lat = location.latitude
Long = location.longitude
print('LAT: ',location.latitude)
print('LONG:', location.longitude)
LAT: 37.47480245
LONG: -105.8819230946304
geolocator = Nominatim(user_agent="MyApp")
location = geolocator.reverse("37.474802,-105.881923")
state = location.raw.get('address').get('State')
city = location.raw.get('address').get('City')
print('State: ',state)
print('City: ',city)
State: None
City: None
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论