This section will explain how the different kind of trips will be monitored and what is expected as result.
Since all drivers will send events regularly, a trip starts with the first event to a stop.
Trip starts from a location other than a depot and we assume the trip will executed in planned order and driver will send position regularly.
e.g. driver start from home (has already loaded goods the day before)
Since trip starts from a location other than a first depot we could already check ETA for the first depot if driver sends events to stop[0]. All following stations will be informed about ETA violations in this case.
Driver will start with stop[0] and continue with stop[2] and stop[3] and finally go to stop[1], then stop[1] will only be monitored during events to stop[0] and events to stop[1] and certainly notify an ETA violation. The transport service provider can avoid this ETA violation by changing the tour via tour UPDATE method.
If driver sends only positions near arrival, incidents or other traffic related events will force (Nicht definierte Variable:Variables.Product)e to calculate an approximated position based on internal assumptions. If the internal calculated position leads to an ETA violation all subscriber will be informed.
A transport service provider has a trip planned with another trip planning system. This trip should have several stops (at least one) and for each stop there are coordinates available and time intervals given to monitor.
In order to transmit a trip to (Nicht definierte Variable:Variables.Product) you need a token. A token gives you the permission to create new monitoring orders in (Nicht definierte Variable:Variables.Product). You can buy a token from PTV Group. You will be billed per trip monitored.
Calling the method https://driveandarrive-v1.cloud.ptvgroup.com/em/tour?Token=<token> will transmit a trip to (Nicht definierte Variable:Variables.Product). Please refer to "/tour/ POST - create a tour (relevant to billing)" to get a detailed descriptions of the JSON object, including all necessary parameters. Example with three stops
{ "tour": { "stops": [ { "_stopDescription": "station 1 or depot", "coordinate": { "locationX": 8.61638888888889, "locationY": 49.81833333333333 }, "earliestArrivalTime": "2013-03-07T08:00:00.000+01:00", "latestDepartureTime": "2013-03-07T08:00:00.000+01:00", "serviceTimeAtStop": 0, "useServicePeriodForRecreation": true, "weightWhenLeavingStop": "6908,272 kg" }, { "_stopDescription": "station 2", "coordinate": { "locationX": 8.565, "locationY": 49.966111111111104 }, "earliestArrivalTime": "2013-03-07T08:29:20.000+01:00", "latestDepartureTime": "2013-03-07T08:44:20.000+01:00", "serviceTimeAtStop": 900, "useServicePeriodForRecreation": true, "weightWhenLeavingStop": "6835,772 kg" }, { "_stopDescription": "station 3", "coordinate": { "locationX": 8.56861111111111, "locationY": 49.97972222222221 }, "earliestArrivalTime": "2013-03-07T08:49:10.000+01:00", "latestDepartureTime": "2013-03-07T09:04:10.000+01:00", "serviceTimeAtStop": 900, "useServicePeriodForRecreation": true, "weightWhenLeavingStop": "6790,496 kg" } ], "vehicle": { "vehicleProfileID": "mg-truck-40t" }, "drivers": [ { "driverDescription": "driver 57754", "raSTime": { "remainingDrivingTime": 7200, "nextBreakPeriod": 900, "drivingTimeFollowingNextBreak": 16200 } } ], "customData": { "your_attribute" : "your_data" } } }
This tour object can have multiple stops. Each stop has information about
earliestArrivalTime - time the driver will be at the stop in UTC format, e.g. "2014-01-15T08:30:45.000+01:00",
latestDepartureTime - time the driver will leave the stop at latest in UTC format, e.g. "2014-01-15T09:04:10.000+01:00",
serviceTimeAtStop - needed time for service at this stop in seconds, e.g. 900
useServicePeriodForRecreation - service can used for recreation, e.g. true or false
weightWhenLeavingStop - weight of the truck leaving this stop in kg, e.g. 6790,496
and coordinates.
These coordinates have to be in WGS 84 (lon, lat) for (x,y).
A time stamp in (Nicht definierte Variable:Variables.Product) has the following format YYYY-MM-DDThh:mm:ss.000+hh:mm in UTC.
In JavaScript you can create this format as follows:
function formatDate(myDate) { var myYear = myDate.getFullYear(); var myMonth = myDate.getMonth()+1; var myDay = myDate.getDate(); var myH = myDate.getHours(); var myMin = myDate.getMinutes(); var mySec = myDate.getSeconds(); return myYear+'-'+(myMonth<10?('0'+myMonth):myMonth)+'-'+(myDay<10?('0'+myDay):myDay)+'T'+(myH<10?('0'+myH):myH)+':'+(myMin<10?('0'+myMin):myMin)+':'+(mySec<10?('0'+mySec):mySec)+'.000+0100' }
In Java you can use SimpleDateFormat with a pattern "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
In C# you can use a ToString("yyyy-MM-ddTHH\:mm\:ss.fffzzz")
To specify a vehicle, the definition of an vehicle profile "vehicle" is needed. The following "vehicleProfileID"'s are possible:
mg-car (< 3,5t; height 1,50m; length 4,20m; width 1,76m ; max. 135km/h)
mg-transporter (< 3,5t; height 2,54m; length 6m; width 2,00m ; max. 135km/h)
mg-truck-7.5t (7,5t; height 3,40m; length 7,20m; width 2,50m ; max. 85km/h)
mg-truck-11.99t (11,99t; height 3,80m; length 10m; width 2,54m ; max. 85km/h)
mg-truck-40t (40t; height 4m; length 18m; width 2,54m ; max. 85km/h)
mg-trailer-truck (40t; height 4m; length 16.50m; width 2,54m ; max. 80km/h)
If the Token got the WORLD mapCLuster configured, the following VehicleProfiles are available too.
1_pickup
2_van
3_walk_in
4_box_truck
5_delivery
6_stake_body
7_medium_tractor
8_double_trailer
8_heavy_tractor
8_semitrailer_3Axle
8_semitrailer_4Axle
8_semitrailer_5Axle
The parameter "customData" should not be used for any personal related data as vehicle number or driver name to ensure the highest level of data protection. customData can be ciphered, but an API filtered on customData in forthcoming releases cannot be delivered.
Currently there are no customer specific changes, e.g. "avoid toll" possible. Please contact support for further information.
Vehicle profiles have a lot of parameters. These parameters must be coordinated each other. Please contact support for further information.
As a response, you will get back an enriched object with (Nicht definierte Variable:Variables.Product) identifiers (SCEMID) you need later to send stop related data or to get stop related information via subscription. Please store these SCEMID's. For a tour with three stops, this would look like this:
{ "tour": { "stops": [ { "coordinate": { "locationX": 8.000000, "locationY": 50.000000 }, "earliestArrivalTime": "2014-03-07T07:00:00.0000000+00:00", "latestDepartureTime": "2014-03-07T07:00:00.0000000+00:00", "serviceTimeAtStop": 0, "useServicePeriodForRecreation": true, "weightWhenLeavingStop": 0, "scemid": "S57SAAEKNH" }, { "coordinate": { "locationX": 9.000000, "locationY": 49.000000 }, "earliestArrivalTime": "2014-03-07T07:29:20.0000000+00:00", "latestDepartureTime": "2014-03-07T07:44:20.0000000+00:00", "serviceTimeAtStop": 900, "useServicePeriodForRecreation": true, "weightWhenLeavingStop": 0, "scemid": "P27SAAEKNH" }, { "coordinate": { "locationX": 8.000000, "locationY": 50.000000 }, "earliestArrivalTime": "2014-03-07T07:49:10.0000000+00:00", "latestDepartureTime": "2014-03-07T08:04:10.0000000+00:00", "serviceTimeAtStop": 900, "useServicePeriodForRecreation": true, "weightWhenLeavingStop": 0, "scemid": "PJ7SAAEKNH" }, ], "vehicle": { "vehicleProfileID": "mg-truck-40t" }, "drivers": [ { "driverDescription": "driver 1", "raSTime": { "remainingDrivingTime": 7200, "nextBreakPeriod": 900, "drivingTimeFollowingNextBreak": 16200 } } ], "customData": { "your_attribute" : "your_data" }, "scemid": "KL7SAAEKNH" }, "responseStatus":{ "errorCode":"SUCCESS", "message":"000000000000" } }
At the end you have 4 SCEMIDs for a 3-stop tour:
"scemid": "S57SAAEKNH" for station 1
"scemid": "P27SAAEKNH" for station 2
"scemid": "PJ7SAAEKNH" for station 3
"scemid": "KL7SAAEKNH" for the whole tour
© 2022 PTV Planung Transport Verkehr GmbH | Imprint