Use Cases > PTV xRoute > How to Use the Unified Profile Mechanism

How to Use the Unified Profile Mechanism

About Profile Inheritance

When introducing the Unified Profile Mechanism ("UPM"), the vehicle profiles of the PTV xRoute Server gained some changes. They are now subject to an inheritance mechanism which displays the differences of the individual profiles more clearly. You can find the vehicle profiles under <root>/conf/profiles. In principle, the profiles used in PTV xRoute Server can be divided into two categories:

The following table should give you an overview of the existing profiles

PTV xServer profiles Reference profiles
default, carfast, carslow, delivery, emergency, truckfast, truckslow, bicycle, bicycle-oneway, pedestrian mg-car, mg-transporter, mg-truck-7.5t, mg-truck-11.99t, mg-truck-40t, mg-trailer-truck, smt-van, smt-truck-7.5t,
smt-truck-40t-fast, smt-truck-40t-slow

In the PTV xServer profiles, the default profile forms the basis of the inheritance hierarchy. The child profiles only show attribute values which are different from those of the parent profile , or are not executed. For general information about the UPM, please see: About Profiles

The following image shows the inheritance hierarchy of the PTV xRoute profiles:

Example: delivery.xml

<Profile xmlns:ns2="http://www.ptv.de/com/ptvag/xserver/engines/xpoidbaccess" parent="default">
 <Common language="de" majorVersion="1" minorVersion="0" />
 <Routing majorVersion="2" minorVersion="0">
  <Course>
   <BasicDataRules>
    <VehicleSpecific>
	 <DeliveryVehicles segmentMalus="2005"/>
	</VehicleSpecific>
   </BasicDataRules>
  </Course>
  <Vehicle>
   <Legal>
    <LegalConditions isAuthorized="true" isDelivery="true"/>
   </Legal>
  </Vehicle>
 </Routing>
</Profile>

For the reference profiles, there is no exclusive, superordinate profile. Here the PTV Smartour profiles are derived from the appropriate PTV Map&Guide profile (if available). This procedure leads to following hierarchy:

New Reference Profiles

A new concept was created to highlight changes to the reference profiles more clearly. Besides the reference profiles explained above there are new reference profiles which are built up as follows:

The profiles with product abbreviations (mg, smt) should be replaced by these new profiles. On account of backward compatibility the "classic" profiles are still supported in the current version.

To produce a better comparison between the products PTV recommends to use the new reference profiles or derive your own specific profiles out of the new ones

With regards to the content there is no difference between the "classic" and the "new" reference profiles. Both have the current state of the respective profiles used in the corresponding products. The following table shows you the name changes of the reference profiles:

Classic profile (deprecated) New reference profile
mg-truck-40t truck40t_01-00_M
smt-truck-40t-fast truck40t_01-00_S
smt-truck-40t-slow truck40tslow_01-00
mg-truck-11.99t truck11-99t_01-00
mg-truck-7.5t truck7-5t_01-00_M
smt-truck-7.5t truck7-5t_01-00_S
mg-trailer-truck truck-trailertruck_01-00
mg-transporter van_01-00_M
smt-van van_01-00_S
mg-car car_01-00

Note that the reference profiles are read-only. You can derive your own specific profiles out of the reference profiles using their inheritance hierarchy.

Important Notes

The following figure illustrates the entry point in order to modify the relevant vehicle parameters. Detailed information is provided in the section: About Profiles.

Vehicle Routing

The following table lists a bundle of important attributes which differentiate the specific vehicle types based on physical and legal parameters. Therefore, the table below describes the meaning of the attributes located in the main branch "Routing/Vehicle".

Attribute Description
driveType Defines the type of the vehicle, e.g motorized, pedestrian, etc.
emissionTechnology The emission technology (not relevant for all emission classes).
particleFilterInstalled Describes if a particle filter is installed.
particleReductionClass Reduction class describing the vehicle's particle emissions.
emissionClass The emission class.
lowEmissionZoneType The green zone type of the vehicle. The treatment of road segments that are not allowed because of the green zone type is controlled by the bonus/malus value forbiddenLowEmissionZone.
cylinderCapacity The cylinder capacity in [ccm].
fuelType The type of fuel (benzine, diesel, etc.).
bioFuelRatio The ratio of biofuel to conventional fuel in [%].
fuelConsumption The fuel consumption in [l/100km] resp. [kg/100km] (depending on fuel type).
emptyWeight The empty weight in [kg] (without trailer).
totalPermittedWeight The weight of the vehicle's load in [kg].
Note that emptyWeight + loadWeight <= totalPermittedWeight.
loadWeight The total permitted weight (including trailer) in [kg].
axleLoad The axle load in [kg].
numberOfAxles The number of axles the vehicle + trailer has.
emptyWeight (Trailer) The trailer weight in [kg], 0 for vehicles without a trailer. Note that this value is included in totalPermittedWeight.
height The vehicle's height in [cm].
heightAboveFrontAxle Vehicle's height above the front axle in [cm].
length The vehicle's length in [cm]
width The vehicle's width in [cm].
isMaintance True for public maintenance vehicles such as garbage trucks.
isAuthorized True for authorized vehicles.
isEmergency True for emergency vehicles.
isProject True for project vehicles.
isDelivery True for vehicles which are intended to deliver something. This parameter is important by incepting areas which are blocked for transit but allowed for delivery.
hazardousGoodsType Specifies whether the load is hazardous.
loadType The load type of the vehicle, e.g passengers or goods, etc. This parameter is important to derive the type of the vehicle. For example, if the vehicle's weight is about 10 tons, then the load type can help to determine whether the vehicle is a truck or a bus.
tunnelRestrictionCode The tunnel restriction code defining, for example, whether the vehicle is restricted to use the tunnels when carrying dangerous goods or explosives.
speedForAirLineDistance The notional speed for distances on a straight line (e.g. the distance from a waypoint to its link point on the road network) [km/h].
minimumSpeed The minimum speed in [km/h] of all road segments of this network class.
maximumSpeed The maximum speed in [km/h] of all road segments of this network class.

The tables below now show you the new reference profiles default values of the attributes explained above. The most important physical attributes that differ between the profiles are highlighted in red.

PTV Map&Guide reference profiles

Attribute car_01-00 van_01-00_M truck7-5t_01-00_M
driveType MOTORIZED MOTORIZED MOTORIZED
emissionTechnology NONE NONE EXHAUST_GAS_RECIRCULATION
particleFilterInstalled false false false
particleReductionClass 0 0 0
emissionClass EURO_5 EURO_5 EURO_5
lowEmissionZoneType GREEN GREEN GREEN
cylinderCapacity 2200 1600 1600
fuelType DIESEL DIESEL DIESEL
bioFuelRatio 0 0 0
fuelConsumption 0,0001 0,0001 0,0001
emptyWeight 1400 2100 4000
totalPermittedWeight 1770 3500 7500
loadWeight 370 1400 3500
axleLoad 890 1800 2200
numberOfAxles 2 2 2
emptyWeight (Trailer) 0 0 0
height 151 254 340
heightAboveFrontAxle 100 140 340
length 420 600 720
width 176 200 250
isMaintance false false false
isAuthorized true true true
isEmergency false false false
isProject false false false
isDelivery true true true
hazardousGoodsType NONE NONE NONE
loadType PASSENGER GOODS GOODS
tunnelRestrictionCode NONE NONE NONE
speedForAirLineDistance 36 36 36
minimumSpeed 70,35,25,25,20,18,18,18 70,35,25,25,20,18,18,18 55,30,23,20,18,15,15,15
maximumSpeed 135,125,85,60,50,40,40,40 135,125,85,60,50,40,40,40 80,65,55,45,40,30,30,30
Attribute truck11-99t_01-00 truck40t_01-00_M truck_trailertruck_01-00
driveType MOTORIZED MOTORIZED MOTORIZED
emissionTechnology NONE NONE EXHAUST_GAS_RECIRCULATION
particleFilterInstalled false false false
particleReductionClass 0 0 0
emissionClass EURO_5 EURO_5 EURO_5
lowEmissionZoneType GREEN GREEN GREEN
cylinderCapacity 12000 12000 12000
fuelType DIESEL DIESEL DIESEL
bioFuelRatio 0 0 0
fuelConsumption 0,0001 0,0001 0,0001
emptyWeight 6990 15000 14500
totalPermittedWeight 11990 40000 40000
loadWeight 5000 25000 25500
axleLoad 8100 11500 10000
numberOfAxles 2 5 5
emptyWeight (Trailer) 0 15000 28000
height 380 400 400
heightAboveFrontAxle 380 400 400
length 1000 1800 1650
width 254 254 254
isMaintance false false false
isAuthorized true true true
isEmergency false false false
isProject false false false
isDelivery true true true
hazardousGoodsType NONE NONE NONE
loadType GOODS GOODS GOODS
tunnelRestrictionCode NONE NONE NONE
speedForAirLineDistance 36 36 36
minimumSpeed 55,30,23,20,18,15,15,15 55,30,23,20,18,15,15,15 55,30,23,20,18,15,15,15
maximumSpeed 80,65,55,45,40,30,30,30 80,65,55,45,40,30,30,30 80,65,55,45,40,30,30,30

PTV Smartour reference profiles

Attribute van_01-00_S truck7-5t_01-00_S truck40t_01-00_S truck40tslow_01-00
driveType MOTORIZED MOTORIZED MOTORIZED MOTORIZED
emissionTechnology NONE EXHAUST_GAS_
RECIRCULATION
EXHAUST_GAS_
RECIRCULATION
EXHAUST_GAS_
RECIRCULATION
particleFilterInstalled false false false false
particleReductionClass 0 0 0 0
emissionClass EURO_5 EURO_5 EURO_5 EURO_5
lowEmissionZoneType GREEN GREEN GREEN GREEN
cylinderCapacity 1600 4000 12000 12000
fuelType DIESEL DIESEL DIESEL DIESEL
bioFuelRatio 0 0 0 0
fuelConsumption 0,0001 0,0001 0,0001 0,0001
emptyWeight 2100 4000 15000 15000
totalPermittedWeight 3500 7500 40000 40000
loadWeight 0 0 0 0
axleLoad 1800 2200 11500 11500
numberOfAxles 2 2 5 5
emptyWeight (Trailer) 0 0 15000 15000
height 254 340 400 400
heightAboveFrontAxle 140 340 400 400
length 600 720 1800 1800
width 200 250 254 254
isMaintance false false false false
isAuthorized true true true true
isEmergency false false false false
isProject false false false false
isDelivery true true true true
hazardousGoodsType NONE NONE NONE NONE
loadType GOODS GOODS GOODS GOODS
tunnelRestrictionCode NONE NONE NONE NONE
speedForAirLineDistance 36 36 36 36
minimumSpeed 70,35,25,25,
20,18,18,18
55,30,23,20,
18,15,15,15
55,30,23,20,
18,15,15,15
50,28,23,20,
18,15,15,15
maximumSpeed 135,125,85,60,
50,40,40,40
80,65,55,45,
40,30,30,30
80,65,55,45,
40,30,30,30
70,60,52,42,
38,28,28,28

The value of the attribute enabled of the AdditionalDataRules class at the reference profiles was changed from true to false. That is the only difference to the external used profiles used in PTV Map&Guide internet. That change had to be done because at PTV xServer there are no additional data layer delivered by default.

Example

This sample shows the usage of the Unified Profile Mechanism ("UPM"). The profiles are either placed in the file system identified by their specific names or handed over as code snippets, the so-called "snippet mechanism", using the caller context element in your request. This sample shows both capabilities.

The following sample shows a route in Luxembourg which has the destination in the pedestrian area of the Grand-Rue:

You can see the green dot in the Grand-Rue. There is no route to this point because it is a pedestrian area and the passing is not allowed for the most vehicles. A rout will be calculated because PTV xRoute should return always a response to the nearest passable segment.
The passing of the pedestrian area will be enabled in the next section with a profile or a XML snippet.

The JSON request for the method calculateExtendedRoute is:
{
  "waypoints": [
    {
      "$type": "WaypointDesc",
      "linkType": "NEXT_SEGMENT",
      "fuzzyRadius": 0,
      "coords": [
        {
          "$type": "Point",
          "point": {
            "$type": "PlainPoint",
            "x": 681840,
            "y": 6371865
          }
        }
      ]
    },
    {
      "$type": "WaypointDesc",
      "linkType": "NEXT_SEGMENT",
      "fuzzyRadius": 0,
      "coords": [
        {
          "$type": "Point",
          "point": {
            "$type": "PlainPoint",
            "x": 681477,
            "y": 6372244
          }
        }
      ]
    }
  ],
  "options": null,
  "exceptionPaths": null,
  "details": {
    "manoeuvres": false,
    "texts": false,
    "nodes": false,
    "binaryPathDesc": false,
    "polygon": true,
    "detailLevel": "STANDARD",
    "dynamicInfo": false,
    "segments": false,
    "segmentAttributes": false,
    "manoeuvreAttributes": false,
    "brunnelManoeuvres": false,
    "urbanManoeuvres": false,
    "manoeuvreGroups": false,
    "manoeuvreGroupRatio": 0,
    "tollManoeuvres": false,
    "boundingRectanglesC": 0,
    "boundingRectanglesOffset": 0,
    "totalRectangle": false
  },
  "callerContext": {
    "properties": [
      {
        "key": "Profile",
        "value": "truckfast"
      },
      {
        "key": "ResponseGeometry",
        "value": "PLAIN"
      },
      {
        "key": "CoordFormat",
        "value": "PTV_MERCATOR"
      }
    ]
  }
}
Please execute this request in the PTV xServer Raw Request Runner. In the result you can see the distance:
{
  "info": {
    "distance": 1189,
    "time": 194,
    "cost": 2347
  }

Use an xml profile

To enable the passing in the pedestrian area UPM can be used.

The resulting route is:

What we have done?
The profile truck-delivery.xml extends the profile truckfast:

<Profile xmlns:ns2="http://www.ptv.de/com/ptvag/xserver/engines/xpoidbaccess" parent="truckfast">			
With this extension it has the same settings as truckfast. Then the settings for the vehicle will be modified. The delivery flag will be enabled in the Routing element:
<Routing majorVersion="2" minorVersion="0">
 <Course>
  <BasicDataRules>
   <VehicleSpecific>
    <DeliveryVehicles segmentMalus="2500"/>
   </VehicleSpecific>
  </BasicDataRules>
 </Course>
 <Vehicle>
  <Legal>
   <LegalCondition isAuthorized="true" isDelivery="true"/>
  </Legal>
  Vehicle>
</Routing>

More Information is available in chapter Unified Profile Mechanism.

Use the snippet mechanism

It is possible to change the profile without changing the PTV xServer conf directory with the "snippet mechanism".