我正在尝试使用Webots R2019中的Python OSM导入器通过地名生成具有海拔信息的世界文件,但是出现以下错误:
python ~/osm_importer/importer.py --input test.osm --output=map.wbt --enable-3D
Aquiring Elevation, please be patient
Traceback (most recent call last):
File "/home/kennycaldas/osm_importer/importer.py", line 109, in <module>
elevation = Elevation(Projection.getProjection(), minlat=minlat, minlon=minlon, maxlat=maxlat, maxlon=maxlon, googleAPIKey=options.googleAPIKey)
File "/home/kennycaldas/osm_importer/elevation.py", line 115, in __init__
result = Elevation.get_elevation_from_geonames(locations, "cyberbotics")
File "/home/kennycaldas/osm_importer/elevation.py", line 75, in get_elevation_from_geonames
response = json.load(urllib.urlopen(url))
File "/usr/lib/python2.7/urllib.py", line 87, in urlopen
return opener.open(url)
File "/usr/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 350, in open_http
h.endheaders(data)
File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 897, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 859, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 836, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 557, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -5] No address associated with hostname
有人遇到同样的问题吗?
谢谢!
答案 0 :(得分:1)
似乎地理名称海拔API已更改。
您应该能够通过在“ osm_importer / elevation.py”文件中将“ http://ws.geonames.org/astergdemJSON” URL更改为“ http://api.geonames.org/astergdemJSON”来解决此问题。