Page 1 of 1
linking to waypoint indexes and error keys
Posted: Tue Jan 03, 2017 9:55 am
by Creo
Hello everyone.
Recently i started to integrate PTV software with app that im working on and encountered few problems.
So i run default route query on default server configuration and in response this is what i get:
Code: Select all
{
"errorMessage": "linking to waypoint (zero-based index list: 0,1) failed",
"errorKey": "2530",
"exceptionType": "com.ptvag.xserver.xroute.XRouteException"
}
If i understand correctly (first 3 words) server cannot find connection between waypoints on roads network.
How can i understand rest of the information (the zero-based index part)?
Is there some kind of explanation what 0,1 and specific errorKey means?
Thanks in advance for your help.
PS Because im new to PTV dev environment i'll gladly accept any advice that will ease the learning curve.
Re: linking to waypoint indexes and error keys
Posted: Tue Jan 03, 2017 10:11 am
by Bernd Welter
Hello Tomasz,
welcome at the PTV xServer community! Feel free to contribute - even a question strengthens us because we can see where we need to improve documentation
And the forum grows as a knowledgebase!
There is a documentation of the
ErrorCode enumeration in the API docu:
http://xserver.ptvgroup.com/fileadmin/f ... s%7C_____6
Just a few words about routing in general: it is divided into several mandatory / optional steps:
- LINKING (mandatory): the component attaches each waypoint coordinate to the street network. Sometimes this causes the LINKING error when the given coordinate is too far away from the street network or streets that are enabled for the car (e.g. the coordinate is located in a large pedestrian zone). The error message gives you a hint about the coordinates that caused the error. Imagine you provided 4 waypoints. They will be treated as waypoint_0, waypoint_1, waypoint_2 and waypoint_3. If the 2nd and the last element of the list cause LINKING ERRORs you get the hint linking to waypoint (zero-based index list: 1,3) failed. If at least one coordinate causes an error the routing is not computed but interrupted with the error message.
- typical linking error message
- Otherwise the ROUTING step (mandatory) is executed: the algorithm computes the path through the road network and determines it's participating nodes and segments and the KPIs (distance, period) of the route. It could happen that this step produces an error if the settings prevent the algorithm from finding a solution (e.g. LONDON to PARIS but ferries are forbidden): cannot calculate route (concerning leg 1). In this case the index 1 refers to the section between waypoint 0 and 1:
- routing error
- If required the LISTING step (optional) is processed: depending on further settings (ResultListOptions, CountryInfoOptions) the additional output elements such as Emissions, Toll, Itenary and so on are computed.
I hope this little intro answers your questions, if not: let us know!
There are also other posts dealing with linking - you can use the search function to look for them.
Best regards from Germany,
Bernd
(looking forward to a skiing trip with a bunch of Polish guys soon
)