-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
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
JSONDecodeError when requesting directions in gpx format #43
Comments
Raw requests will work (as in the playground). However, ors-py offers some level of abstraction and I'm fairly sure this won't be implemented any time soon (if ever), sorry. It's actually the first time this was raised in > 2 years, so (luckily) not a lot of people have a use case for GPX in Python. Of course happy to review a PR if you wanna add it upstream. The gpxpy package could be an option, seems to be well maintained I wouldn't like the maintenance of GPX parsing in this repo. |
I just realized that the doc string for |
Understood, if gpx is actually not supported, it should not be available as a format option |
Or it could just return the gpx response as plain text, so you can parse it in the client. I also maintain the routing-py package where we actually parse the JSON response, forgot for a moment that ors-py only gives the loaded JSON back anyways without parsing. So it could do the same for GPX, that's true. Would that be enough? |
Plain text response would be great, thanks. My use case for gpx is to save the route to a file that I can load into a navigation program. It would be great to be able to do it without resorting to raw api calls |
Here's what I did
The same request is processed without any errors with format='json' or format='geojson' and the correct route is returned
dry_run output:
Here's what I was expecting
Same directions in GPX format
The same request generated as Python snippet from ORS API playground works correctly:
Here's what I think could be improved
API response in GPX format should be correctly parsed or delivered as is
The text was updated successfully, but these errors were encountered: