Cannot caluclate route concerning leg *number*

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.
peter.detzner
Posts: 12
Joined: Fri Feb 10, 2017 6:57 am

Cannot caluclate route concerning leg *number*

Post by peter.detzner »

Hi!
Right now I am struggeling probably with a small isse which drives me crazy.
I am trying to create a Route between 2 points, a starting point and the destination (Industriekai;24937;Flensburg;).

Everytime I am trying to calculate the Route I am receiving the error "cannot calculate route (concerning leg 1)".

How can I deal with this kind of problem resp. the address? In fact the routing is not possible for this address. Is there any option where I might "enable"?

My Routingoptions are:
parameter = RoutingParameter.OPTIMIZATION, value = "30"
parameter = RoutingParameter.ALLOW_SEGMENT_VIOLATIONS, value = "true"


ResultListOptions:
manoeuvres = false;
manoeuvreAttributes = false;
nodes = true;
polygon = true;


the Profile for the vehicle is truckfast".

Thanks for your help!

Regards,
Peter
Joost
Posts: 318
Joined: Fri Apr 25, 2014 1:46 pm

Re: Cannot caluclate route concerning leg *number*

Post by Joost »

I beleive your issue is cause by local restriction on entering that part of the industrial area. Have a look at http://devblog.ptvgroup.com/2014/01/10/ ... -vehicles/ on information how to open up restricted area's.
Joost Claessen
Senior Technical Consultant
PTV Benelux
peter.detzner
Posts: 12
Joined: Fri Feb 10, 2017 6:57 am

Re: Cannot caluclate route concerning leg *number*

Post by peter.detzner »

Thank you! The link solved my issue. Just changed the profile!
Gerhard
Posts: 11
Joined: Thu Aug 11, 2016 6:41 pm

Re: Cannot caluclate route concerning leg *number*

Post by Gerhard »

I'm having the same issue, using xServer Internet. Regrettably the link provided didn't solve this problem for me.

When I'm adding the code, I actually get another error, telling me that <Violations> must not be a child of <BasicDataRules>. From as far as I can tell <Violations> is on the same level as <BasicDataRules>, so they're actually both childs of <Course>?

I added all the rules to the XML but it seems to have no effect. What am I doing wrong? Here are the params for xRoute.calculateRoute:

Code: Select all

{
  "waypoints":
  [
    {"coords":[{"point":{"x":16.3492375,"y":48.254322}}],"linkType":"NEXT_SEGMENT"},
    {"coords":[{"point":{"x":16.3136262,"y":48.220700}}],"linkType":"NEXT_SEGMENT","viaType":{"viaType":"VIA_STOP"}},
    {"coords":[{"point":{"x":16.3492375,"y":48.254322}}],"linkType":"NEXT_SEGMENT"}
  ],
  "options":
  [
    {"parameter":"OPTIMIZATION","value":90}
  ],
  "exceptionPaths":null,
  "details":
  {
    "polygon":true,
    "boundingRectanglesC":1,
    "boundingRectanglesOffset":300,
    "totalRectangle":true
  },
  "callerContext":
  {
    "properties":
    [
      {"key":"Profile","value":"delivery"},
      {"key":"CoordFormat","value":"OG_GEODECIMAL"},
      {"key":"ResponseGeometry","value":"PLAIN"},
      {"key":"ProfileXMLSnippet","value":"<Profile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://localhost:50090/xtour/schema/XTourProfile.xsd'><Routing majorVersion=\"2\" minorVersion=\"0\"><Course><BasicDataRules><VehicleSpecific><DeliveryVehicles segmentMalus=\"2500\"/><EmergencyVehicles segmentMalus=\"2501\" turningBanCost=\"50000\"/><AuthorizedVehicles turningBanCost=\"50000\"/></VehicleSpecific></BasicDataRules><Violations><SegmentBlockingViolations enabled=\"true\" cost=\"50000\"/></Violations></Course><Vehicle><Legal><LegalCondition isAuthorized=\"true\" isDelivery=\"true\" isEmergency=\"true\" /></Legal></Vehicle></Routing></Profile>"}
    ]
  }
}
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

Hello Gerhard,

the error message I get

Code: Select all

{
  "errorMessage": "cannot calculate route (concerning leg 1)",
  "errorKey": "2500",
  "exceptionType": "com.ptvag.xserver.xroute.XRouteException"
}
https://xroute-eu-n-test.cloud.ptvgroup ... quest.html

Did you send the request to the proper method (calculateRoute) via JSON?

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:
Image
Gerhard
Posts: 11
Joined: Thu Aug 11, 2016 6:41 pm

Re: Cannot caluclate route concerning leg *number*

Post by Gerhard »

Hi Bernd,

yes, that's exactly the message that I'm getting, the same as mentioned by peter.detzner in the first post. I already implemented the fix according to the second post as you can see in my code example, but still getting the error.

Same happens btw for the GPS-position x: 15.0653484, y: 47.0596209 so we had this issue in several cases lately. It occurs when the last bit of the route to the destination is a pedestrian area or similar, I think.

I already tried FUZZY_LINKING ...

Code: Select all

"waypoints":
  [
    {"coords":[{"point":{"x":16.3492375,"y":48.254322}}],"linkType":"NEXT_SEGMENT"},
    {"coords":[{"point":{"x":16.3136262,"y":48.220700}}],"linkType":"FUZZY_LINKING","fuzzyRadius":250},
    {"coords":[{"point":{"x":16.3492375,"y":48.254322}}],"linkType":"NEXT_SEGMENT"}
  ],
... but still getting the same error.

The documentation for linkType = NEXT_SEGMENT says
The waypoint has to be linked to the geographically nearest valid segment within the configured link distance. A segment is valid if it can be used by the configured vehicle type.
How can I configure the link distance mentioned here?
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

Hello Gerhard,

The linking distances are part of the node WAYPOINT:

Code: Select all

<Waypoint linkType="ROAD" maximumDistanceToCombinedTransport="100" maximumDistanceToSegment="1000">
	<LinkTypeConfiguration>
		<Road headingTolerance="360" maximumDistanceForNetworkClass0="1000" maximumNetworkClass="7" minimumNetworkClass="0" onlyReachableRoads="true"/>
		<Smart checkNetworkClassOnlyForVias="true" maximumDistanceToMainNode="100" maximumDistanceToMainNodeForNetworkClass0="1500"/>
		<TollStation maximumDistance="1000"/>
		<RoadName maximumDistance="3000" maximumDistanceToMainNode="2000"/>
	</LinkTypeConfiguration>
</Waypoint>
I recommend to use AUTO_LINKING as the Linking Type for the Waypoints via the API / JSON.

Best regards,
Bernd

PS:
Fuzzy linking is a mechanism that is only valid for inner waypoints (not start or end) because the target of FUZZY is to push a route on a specific area (e.g. standard route from Hamburg to Munich takes a track through West Germany and you'd like to push East Germany).
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:
Image
Gerhard
Posts: 11
Joined: Thu Aug 11, 2016 6:41 pm

Re: Cannot caluclate route concerning leg *number*

Post by Gerhard »

Hi Bernd,

thank you for the prompt and detailed explanation. Regrettably neither changing the linkType to AUTO_LINKING, nor the Waypoint XML-Code solved my problem. :?

Here's the code I tried (even changed the maximumDistance* vars from 100 to 1000):

Code: Select all

{
  "waypoints":
  [
    {"coords":[{"point":{"x":16.3492375,"y":48.254322}}],"linkType":"NEXT_SEGMENT"},
    {"coords":[{"point":{"x":16.3136262,"y":48.220700}}],"linkType":"AUTO_LINKING","viaType":{"viaType":"VIA_STOP"}},
    {"coords":[{"point":{"x":16.3492375,"y":48.254322}}],"linkType":"NEXT_SEGMENT"}
  ],
  "options":
  [
    {"parameter":"OPTIMIZATION","value":90}
  ],
  "exceptionPaths":null,
  "details":
  {
    "polygon":true,
    "boundingRectanglesC":1,
    "boundingRectanglesOffset":300,
    "totalRectangle":true
  },
  "callerContext":
  {
    "properties":
    [
      {"key":"Profile","value":"delivery"},
      {"key":"CoordFormat","value":"OG_GEODECIMAL"},
      {"key":"ResponseGeometry","value":"PLAIN"},
      {"key":"ProfileXMLSnippet","value":"<Profile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://localhost:50090/xtour/schema/XTourProfile.xsd'><Routing majorVersion=\"2\" minorVersion=\"0\"><Waypoint linkType=\"ROAD\" maximumDistanceToCombinedTransport=\"1000\" maximumDistanceToSegment=\"1000\"><LinkTypeConfiguration><Road headingTolerance=\"360\" maximumDistanceForNetworkClass0=\"1000\" maximumNetworkClass=\"7\" minimumNetworkClass=\"0\" onlyReachableRoads=\"true\"/><Smart checkNetworkClassOnlyForVias=\"true\" maximumDistanceToMainNode=\"1000\" maximumDistanceToMainNodeForNetworkClass0=\"1500\"/><TollStation maximumDistance=\"1000\"/><RoadName maximumDistance=\"3000\" maximumDistanceToMainNode=\"2000\"/></LinkTypeConfiguration></Waypoint><Course><BasicDataRules><VehicleSpecific><DeliveryVehicles segmentMalus=\"2500\"/><EmergencyVehicles segmentMalus=\"2501\" turningBanCost=\"50000\"/><AuthorizedVehicles turningBanCost=\"50000\"/></VehicleSpecific></BasicDataRules><Violations><SegmentBlockingViolations enabled=\"true\" cost=\"50000\"/></Violations></Course><Vehicle><Legal><LegalCondition isAuthorized=\"true\" isDelivery=\"true\" isEmergency=\"true\" /></Legal></Vehicle></Routing></Profile>"}
    ]
  }
}
Any suggestions on how to solve the issue?

Thanks again!
Gerhard
Posts: 11
Joined: Thu Aug 11, 2016 6:41 pm

Re: Cannot caluclate route concerning leg *number*

Post by Gerhard »

No solution for this? :cry:
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

Hello again,

sorry, didn't have time for deeper analysis so far. From what I see there are two topics involved:
  • the map you use - the behaviour does not occur in the same way with other maps
  • the delivery flag: alternating this boolean parameter switches from error (isDelivery=true) and success (isDelivery=false)

    Code: Select all

    <Profile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://localhost:50090/xtour/schema/XTourProfile.xsd'>
    	<Routing majorVersion="2" minorVersion="0">
    		<Vehicle>
    			<Legal>
    				<LegalCondition isAuthorized="false" isDelivery="true" isEmergency="false" />
    			</Legal>
    		</Vehicle>
    	</Routing>
    </Profile>
@Joost, Julien: any clue why this happens? I would understand it the other way round but not like that.
Could an error in the data cause this?

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:
Image
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

So here we go... though I can't provide a 100% solution I have new info about this (thanks to Frank for the analysis):

The area we are refering to seems to be restricted by so-called gates.

Let's start with some screenshots from an internal tool:
entering from the north doesn't work because there are turning restrictions which prevent us from getting into the delivery area.
entering from the north doesn't work because there are turning restrictions which prevent us from getting into the delivery area.
Entering from the south is also impossible due to the same turning restrictions.
Entering from the south is also impossible due to the same turning restrictions.
We successfully entered the area if we allow violations of turnings:<br />        &lt;Course&gt;<br />            &lt;Maneuver considerTurningBans=&quot;false&quot; uTurnCost=&quot;5000&quot;/&gt;<br />        &lt;/Course&gt;
We successfully entered the area if we allow violations of turnings:
<Course>
<Maneuver considerTurningBans="false" uTurnCost="5000"/>
</Course>
But probably it is not a sufficient approach to enable this kind of flexibility.
http://devblog.ptvgroup.com/2014/01/10/ ... -vehicles/
So for now I can only explain the response.

If you set the deliveryFlag to false the linking favours a segment which can be reched without such problems:
(Linking successful to the segment in the east - further away but easier to reach)
(Linking successful to the segment in the east - further away but easier to reach)
Does this help?

Bet 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:
Image
Gerhard
Posts: 11
Joined: Thu Aug 11, 2016 6:41 pm

Re: Cannot caluclate route concerning leg *number*

Post by Gerhard »

Hi Bernd,

Code: Select all

<Course>
<Maneuver considerTurningBans="false" uTurnCost="5000"/>
</Course>
actually did the trick for us. Thank you very much, your support is really outstanding!!
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

If you are happy with our work: tell our management.
If not: tell us ;-)

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:
Image
Joost
Posts: 318
Joined: Fri Apr 25, 2014 1:46 pm

Re: Cannot caluclate route concerning leg *number*

Post by Joost »

I recently ran into a similar issues, I believe that these are are actually map errors. IMO the gates should have exceptions for the authorized flag. I' m checking this with our data department.
Joost Claessen
Senior Technical Consultant
PTV Benelux
pssdiogo
Posts: 16
Joined: Wed Oct 29, 2014 3:13 pm

Re: Cannot caluclate route concerning leg *number*

Post by pssdiogo »

Hi Bernd

I'm facing the same error "Cannot calculate route concerning leg *number*" with the following address:

Rue de la Source 5
1020 Renens

https://goo.gl/maps/8dyJykFku9ZmCArSA



I have tried the suggestions:
http://devblog.ptvgroup.com/2014/01/10/ ... -vehicles/
https://xserver.ptvgroup.com/forum/post ... 552#pr1950

But none worked for me.

But, it works by changing the delivery flag: alternating this boolean parameter switches from error (isDelivery=true) and success (isDelivery=false)


Thank you in advance for your support.
Best regards
Pedro Diogo
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

Hello Pedro,

looks like the road is forbidden in the TOMTOM data:
Left: map data TOMTOM : segment &quot;rue de la source&quot; looks like a pedestrian road. Not applicable for &quot;ordinary&quot; cars.
Left: map data TOMTOM : segment "rue de la source" looks like a pedestrian road. Not applicable for "ordinary" cars.
In the HERE map it is a regular road.
HERE map
HERE map
Maybe you can provide your exact XML request so we can reproduce and "tune" it?

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:
Image
pssdiogo
Posts: 16
Joined: Wed Oct 29, 2014 3:13 pm

Re: Cannot caluclate route concerning leg *number*

Post by pssdiogo »

Hi Bernd

Thank you for your fast reply.
Follows attached the XML request.

Best regards
Pedro Diogo
Attachments
xRouteRequest.XML
(12.18 KiB) Downloaded 813 times
User avatar
Bernd Welter
Site Admin
Posts: 3091
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Cannot caluclate route concerning leg *number*

Post by Bernd Welter »

Hello Pedro,

here's the result of our development team's analysis:
The violation concept does not help here as this is only valid for segment attributes like blockings. For geographic restrictions used here there is no possibility other than modifying them (e.g. including France to the allowed countries).
In this special case you can play around with the linking. If you set the link type of the second waypoint to "NEXT_NODE" than it works as the waypoint is linked a bit more east. Or you can "move" the waypoint a bit more away from the border. In any case you have to handle such waypoints manually.
So while violations can help with a spcific category of restrictions this does not apply in your scenario.
Sorry for that output - sounds like this case needs a special manual treatment.

Best regards,
Bernd

PS: I also want to emphasize that this isn't a but of the engine.
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:
Image
pssdiogo
Posts: 16
Joined: Wed Oct 29, 2014 3:13 pm

Re: Cannot caluclate route concerning leg *number*

Post by pssdiogo »

Hi Bernd

It's clear now.
Thank you for your help.

Best regards
Pedro Diogo
lk-tis
Posts: 3
Joined: Tue Aug 20, 2019 1:30 pm

Re: Cannot caluclate route concerning leg *number*

Post by lk-tis »

Hello,

we also have a problem with the error message "cannot calculate route (concerning leg X)".
We have already tried a little bit with the parameters "isDelivery", "isAuthorized" and "isEmergency".
Generally we noticed that by setting these parameters more routes could be calculated. However, we also had a few cases where setting the "isEmergency" parameter resulted in an incorrect calculation.

Now we have a route where setting the "isDelivery" parameter leads to an error.
We have also tried setting "<Maneuver considerTurningBans="false" uTurnCost="5000"/>" which did not help.

I put the route
waypoints.txt
waypoints
(262 Bytes) Downloaded 535 times
and the XMLProfileSnippet
Profile.xml
XMLProfileSnippet
(1.52 KiB) Downloaded 566 times
in the attachment.

Can you help us to fix the problem?

With kind regards
Lennart Kampshoff
Post Reply