I would like to calculate a route with multiple way points in it, each point having a pause time when reached.
To express this pause time, I've seen in the documentation the "servicePeriod" field, in the "TourPointDesc" class. I know there is an identical field name when contacting the xTour.planBasicTours() method which works nicely when I tested it.
Unfortunately, I can't make it work when using xRoute.calculateRoute(). I defined the type of my way points to "TourPointDesc" and added the "servicePeriod" value for each point.
I came up with this JSON body when contacting xRoute.calculateRoute() :
Code: Select all
{
"waypoints":[
{
"linkType":"NEXT_SEGMENT",
"$type" : "TourPointDesc",
"servicePeriod": 3600,
"coords":[
{
"point":{
"x":-0.6446577,
"y":44.840727
}
}
]
},
{
"linkType":"NEXT_SEGMENT",
"$type" : "TourPointDesc",
"servicePeriod": 3600,
"useServicePeriodForRecreation": false,
"completeServiceInIntervals": true,
"coords":[
{
"point":{
"x":2.2828813,
"y":48.82943
}
}
]
},
{
"linkType":"NEXT_SEGMENT",
"$type" : "TourPointDesc",
"servicePeriod" : 3600,
"coords":[
{
"point":{
"x":-0.6446577,
"y":44.840727
}
}
]
}
],
"options": null,
"exceptionPaths":null,
"details":{},
"callerContext":{
"properties":[
{
"key":"CoordFormat",
"value":"OG_GEODECIMAL"
}
]
}
}
Code: Select all
{
"info": {
"distance": 1157801,
"time": 37176,
"cost": 531286,
"hasViolations": false
},
"stations": [
{
"$type": "WayPoint",
"accTime": 0,
"accDist": 0,
"iuCode": 33,
"polyIdx": 0,
"nodeIdx": 0,
"segmentIdx": 0,
"manoeuvreIdx": -1,
"locationCoord": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": -0.64469578361,
"y": 44.84071499
}
},
"matchCoord": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": -0.64483222106,
"y": 44.840324819
}
},
"wayPointType": "START",
"countryCode": ""
},
{
"$type": "WayPoint",
"accTime": 18920,
"accDist": 570112,
"iuCode": 33,
"polyIdx": 3545,
"nodeIdx": 2910,
"segmentIdx": 2049,
"manoeuvreIdx": 0,
"locationCoord": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": 2.2828578219,
"y": 48.829414984
}
},
"matchCoord": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": 2.2831254349,
"y": 48.829262297
}
},
"wayPointType": "VIA",
"countryCode": ""
},
{
"$type": "WayPoint",
"accTime": 37166,
"accDist": 1157707,
"iuCode": 33,
"polyIdx": 6844,
"nodeIdx": 5534,
"segmentIdx": 3788,
"manoeuvreIdx": -1,
"locationCoord": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": -0.64469578361,
"y": 44.84071499
}
},
"matchCoord": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": -0.64483222106,
"y": 44.840324819
}
},
"wayPointType": "DEST",
"countryCode": ""
}
]
}
When contacting the xTour.planBasicTours() method, I can clearly see these servicePeriods being added to the estimated time.
Could someone tell me what I am missing please ?
Thank you very much for your help.