I'm trying to use the Python OSM importer from Webots R2019 to generate a world file with elevation information, using Geonames, but I'm getting the following error:
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
Is anyone having the same problem?
Thank you!
It seems the geonames elevation API has changed.
You should be able to fix the problem by changing the 'http://ws.geonames.org/astergdemJSON' url by 'http://api.geonames.org/astergdemJSON' in the 'osm_importer/elevation.py' file.