2

我正在尝试使用来自 Webots R2019 的 Python OSM 导入器使用 Geonames 生成具有高程信息的世界文件,但出现以下错误:

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

有没有人有同样的问题?

谢谢!

4

1 回答 1

1

似乎地名海拔 API 已更改。

您应该能够通过在“osm_importer/elevation.py”文件中将“ http://ws.geonames.org/astergdemJSON ”网址更改为“ http://api.geonames.org/astergdemJSON ”来解决问题。

于 2019-01-28T09:26:17.963 回答