GPX endpoint returns erroneous routes

Hi,
Whats happen with openroute service?

I query distance ~ 1km and get back 5Mb xml with ~243 route points.

Python Code here:

import requests
values = { “coordinates”: [[21.010667, 56.500625],[21.01522, 56.50665]]}
headers = {‘Accept’:'application/gpx+xml, application/geo+json, application/json; charset=utf-8, ‘Authorization’: ‘mykey’ }
response = requests.post(‘https://api.openrouteservice.org/v2/directions/driving-car/gpx’, json=values, headers=headers)
print(response.text)

When I draw points in map, I get this terrible route between 2 points:

When I query route with distance ~ 600km I get ~ 240000(!!!) route points in returned xml file :frowning:

Some time ago all worked fine…

WBR
Janis

Yes you’re right. Same thing if I plot the gpx from our API playground in an online viewer… It creates a line from the source to every waypoint.

@adam who’s our XML expert?

Hmmm … it’s terrible :slight_smile:
~ a month ago with this query I get normal route from point A to B without direct lines between
every waypoint and destination point :frowning:
what do I do?
what has changed during the last month?

Well, first of all GPX is the worst and most terrible format this planet has ever seen. So obviously my first recommendation is to request GeoJSON.

AAAAAAAA!!!
For a whole month I build my programm to use this Python code and all worked very fine.
I got normal small xml file with normal route. When I put geopoints to map I got
nice route from point A to point B. Not direct line - with minimum geopoints for
building shortest way.
Whats happened???
Why now openroute return this terrible xml ???

BBBBBB!!

Why the hell are you using XML/GPX?

Just use GeoJson. In Python that’s a huge pain to use xml.

Use either routingpy or openrouteservice-py (Python libraries). They have both been designed to take burden off your shoulder.

This code sent to me some from openroute forum, and this code
worked well until today :frowning:
Now remake all my project ??? Ufff …

Can You send to me some example how to use routingpy or openrouteservice-py ?
I need to get shortest route only between two geopoints … preferred in xml format

Both libraries (very deliberately) do not support GPX/XML.

Also, please be a little more respectful around here if you want help. Please and thanks are still concepts that bring you a long way. And using ‘terrible’ in every second sentence for an open-source and free project doesn’t help.

That being said, I’m sure you know how Google works. I lost interest in this.

I’m very sorry, I’m just in despair because soon my programme needs to be ready.
I’m sorry again.

English is not my native language, and ‘terrible’ is first what I found with google translate :slight_smile:
Not personal, You do a great job.
Thanks. :slight_smile:

It’s ok, sorry, you got me on to the wrong foot there yesterday.

Someone will look into it next week. We’ll update this thread when we have some findings.

Hi Nil.
All right, I trying openrouteservice-py scripts with geojson … all work fine :slight_smile:
Thanks.

Hi @Janex72, thank you for reporting this bug. A fix is on the way and will be introduced soon. It’s a nasty little bug, but easy to fix ;). Of course your’re welcome to use GPX but as Nils stated before, I would also recommend you to use GeoJSON when possible. It’s quite advanced and better suited, structured, readable etc. for geometric features.

GitHub Issue

Greetings Julian