We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import openrouteservice
API_KEY = "123" client = openrouteservice.Client(key = API_KEY, base_url = 'https://api.openrouteservice.org')
down = ((8.3075423,46.6122285 ),(8.227912878765892,46.70533443143516)) up = ((8.227912878765892,46.70533443143516),(8.3075423,46.6122285))
coords=up geometry = client.directions(coords, profile='driving-car', preference='shortest',units='km',language='en', geometry='true', geometry_format='encodedpolyline', elevation='true', extra_info=['steepness']) decoded = openrouteservice.convert.decode_polyline(geometry) print(decoded)
$ py orstest.py Traceback (most recent call last): File "orstest.py", line 13, in decoded = openrouteservice.convert.decode_polyline(geometry) File "C:\Users\m50\AppData\Local\Programs\Python\Python36\lib\site-packages\openrouteservice\convert.py", line 150, in decode_polyline b = ord(polyline[index]) - 63 - 1 KeyError: 0
The text was updated successfully, but these errors were encountered:
Thanks for creating the first real issue:)
I'll have someone take a look at this asap. The original code was taken from the Google Maps client, I didn't check for elevation.
Sorry, something went wrong.
Finally done and merged into master. A v1 will soon be available on PyPI, but feel free to test the master branch.
master
v1
No branches or pull requests
import openrouteservice
API_KEY = "123"
client = openrouteservice.Client(key = API_KEY, base_url = 'https://api.openrouteservice.org')
Handegg 6, Guttannen: 46.6122285, 8.3075423
Dorfstrasse, Innertkirchen: 46.70533443143516, 8.227912878765892
down = ((8.3075423,46.6122285 ),(8.227912878765892,46.70533443143516))
up = ((8.227912878765892,46.70533443143516),(8.3075423,46.6122285))
coords=up
geometry = client.directions(coords, profile='driving-car', preference='shortest',units='km',language='en', geometry='true', geometry_format='encodedpolyline', elevation='true', extra_info=['steepness'])
decoded = openrouteservice.convert.decode_polyline(geometry)
print(decoded)
$ py orstest.py
Traceback (most recent call last):
File "orstest.py", line 13, in
decoded = openrouteservice.convert.decode_polyline(geometry)
File "C:\Users\m50\AppData\Local\Programs\Python\Python36\lib\site-packages\openrouteservice\convert.py", line 150, in decode_polyline
b = ord(polyline[index]) - 63 - 1
KeyError: 0
The text was updated successfully, but these errors were encountered: