these days a customer asked me about some issues within routing. Some of his waypoints are locate far away from the regular street network and he wanted to know how to deal with this. So here are some basics of linking that should enable you to optimize your requests
It is possible to request some details about this linking process. Just use the RoutingOption.GENERATE_EXTWAYPOINTS and the server returns info such as airline distance between Waypoint input coordinates and the linking points.
If necessary you can reduce or enlarge the search tolerance for the linking points search by using the snippet or profile:
The following code reduces the search range to a limit of 50m.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Routing majorVersion="2" minorVersion="0">
<Waypoint maximumDistanceToSegment="50">
</Waypoint>
</Routing>
</Profile>
Code: Select all
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:2530</faultcode>
<faultstring>linking to waypoint (zero-based index list: 0,1) failed</faultstring>
<detail>
<ns3:XRouteException xmlns:ns6="http://exception.core.jabba.ptvag.com" xmlns:ns4="http://types.xroute.xserver.ptvag.com" xmlns:ns3="http://xroute.xserver.ptvag.com" xmlns:ns2="http://baseservices.service.jabba.ptvag.com" xmlns:ns1="http://common.xserver.ptvag.com" xmlns:ns0="http://wrappertypes.service.jabba.ptvag.com">
<ns6:stackElement className="com.ptvag.xserver.xroute.XRouteException" errorKey="2530" message="linking to waypoint (zero-based index list: 0,1) failed">
<ns6:cause xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<ns6:wrappedContext xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</ns6:stackElement>
</ns3:XRouteException>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
In xRoute 2 the error message looks like this (JSON style):
Code: Select all
{"faultInfo":
{"$type":"WaypointNotLinkableFault",
"hint":"Make sure that the coordinates of the waypoints in question are covered
by the map data and are close to a road segment valid for the given vehicle.",
"waypointIndices":[0] ...
},
"message":"Some waypoints of the request could not be linked to the road network."
}
The linking distance is just one out of several parameters that have impact on this scenario. Feel free to get back to us if you have some challenges dealing with such plots. And be aware that there is always a message behind a linking error - therefore do not increase the radius if it is important for you to recognize whether you are far of!
Update 4.8.2021 (xRoute2):
In xRoute 2 you can specify the Linking parameters via the RequestProfile.RoutingProfile
Best regards
Bernd