XS1 to XS2: speed profiles and maximumSpeed

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2580
Joined: Mon Apr 14, 2014 10:28 am
Contact:

XS1 to XS2: speed profiles and maximumSpeed

Post by Bernd Welter »

HI there,

let me draw your attention to the following change between xRoute 1 and xRoute 2: these days a player wanted to compare results of xRoute1.calculateExtendedRoute with xRoute2.calculateRoute. In both cases the speed values mentioned in his requests looked equal but the driving periods of the results differed.

He specified 2x8 speed values as described in https://xserver2-europe-eu-test.cloud.p ... asses.html
API doc says "default is 255"
API doc says "default is 255"
We identified the maximumSpeed parameter as the cause for the gap:
https://xserver2-europe-eu-test.cloud.p ... ile.Speeds

Though the maximumSpeed is labeled optional with a default of 255 km/h the xServer2 result never drove faster than 80km/h. Now this is what you should be aware of:
- the xroute1 default profile does not contain a maxSpeed value, therefore the documented default value of 255 applies. As most routings deal with speed vectors below 255 we wouldn't have to cut speeds.
- the xRoute2 default profile explicitly mentions a maximumSpeed of 80km/h which means that the default value of the documentation is never reached. Instead of this the speed values will be cut to 80km/h if you do not explicitly override the maximumSpeed with the request.
Both routings applied the same speed vector (130,90,80,50,50,40,40,40) and looked for the &quot;fastest&quot; route.<br />LEFT: no explicit maximumSpeed in the API call. Therefore an implicit &quot;cut over 80&quot; is applied due to the default profile. Therefore the detour as shown in the right image doesn't make sense.
Both routings applied the same speed vector (130,90,80,50,50,40,40,40) and looked for the "fastest" route.
LEFT: no explicit maximumSpeed in the API call. Therefore an implicit "cut over 80" is applied due to the default profile. Therefore the detour as shown in the right image doesn't make sense.
I forwarded this experience to DEV and recommended a clear comment in the API doc ;-)

Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply