Use Cases > PTV xMap > How to Use Feature Layer Theme PTV_TruckWaitingTimes

How to Use Feature Layer PTV_TruckWaitingTimes

The Feature Layer PTV_TruckWaitingTimes provides data about waiting times for trucks at toll booths along a route. With the PTV xRoute and PTV xMap Server you are able to consider these waiting times in your route calculation and to visualize them on the map.

Related Topics

The following topics might be relevant for this use case.

Terminology

Feature Layer

The Feature Layer (FL) defines the additional data mechanism. The data is partitioned into several themes that characterise different use cases. For example PTV_TruckWaitingTimes is such additional data.

Benefits

PTV xRoute Server

PTV xMap Server

Additionally, users can easily visualizePTV_TruckWaitingTimes data on a map using the PTV xMap Server. This visualisation on the map has the following benefits for customers:

Prerequisites

Check, if the following prerequisites are fulfilled before you start with the use case.

Concept

Feature layers are designed to provide various additional data to the user. The content depends on the feature layer theme and can be configured via XML profile. In the PTV xRoute server, feature layer data can be requested as generic FeatureDescription element for each route segment.

Installation Guide

Programming Guide

Feature Matrix for Feature Layer: PTV_TruckWaitingTimes

Find out which service method of the PTV xRoute Server supports the PTV_TruckWaitingTimes Feature Layer theme.

Service Method PTV_TruckWaitingTimes
calculateRouteInfo x
calculateRoute x
calculateExtendedRoute x
calculateTour -
calculateAdvancedTour -
calculateMatrixInfo x
calculateReachableObjects -
searchForReachableObjects -
calculateIsochrones -

 

Use a PTV xRoute request with at least two stations where a waiting situation at a toll booth is in between and enable the use of the Feature Layer theme PTV_TruckWaitingTimes by setting the following XML profile snippet in the CallerContext of this request.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Profile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
 <FeatureLayer majorVersion='1' minorVersion='0'>
  <Themes>
   <!--enable the PTV_TruckWaitingTimes theme-->
   <Theme id='PTV_TruckWaitingTimes' enabled='true'/>
  </Themes>
 </FeatureLayer>
 <Routing majorVersion='2' minorVersion='0'>
  <Course>
   <!--enable additional data rules to enable routing with additional content like feature layer-->
   <AdditionalDataRules enabled='true'/>
  </Course>
 </Routing>
</Profile>
		

 

Below you can find a JSON sample request which can be directly copied and put into the raw request runner of an xRoute Server to be tested.

By setting "dynamicInfo" : "true" in the request you will receive the actual waiting time for the route in the response (timeLoss).

The following table shows the impact and difference of PTV_TruckWaitingTimes at different times of the day compared to the regular routing without Feature Layer using the request above.


Time stamp Travel time with
PTV_TruckWaitingTimes
Travel time without
PTV_TruckWaitingTimes
10/10/2016
09:00 am
84 seconds 17 seconds
10/10/2016
12:00 pm
46 seconds 17 seconds

Visualisation of PTV_TruckWaitingTimes on the Map

This section describes the general workflow on how to visualizePTV_TruckWaitingTimes on the map.


Workflow


ProfileXMLSnippet: Enabling Feature Layer PTV_TruckWaitingTimes

<Profile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <FeatureLayer majorVersion='1' minorVersion='0'>
    <!--enable the time dependency because we are using the time dependent PTV_TruckWaitingTimes theme-->
    <GlobalSettings enableTimeDependency='true'/>
    <Themes>
      <!--enable the PTV_TruckWaitingTimes theme-->
      <Theme id='PTV_TruckWaitingTimes' enabled='true'/>
    </Themes>
  </FeatureLayer>
</Profile>
		

Default Rendering Settings for PTV_TruckWaitingTimes

The following section shows the default settings of the PTV_TruckWaitingTimes Feature Layer in the silkysand rendering style, which is used for the following examples. These settings are displayed and summarized with the associated XML snippets. Please refer to About Feature Layer Rendering for an overview of all rendering possibilities.


This sample rendering profile displays different icons on the map depending on the duration of the waiting time at toll booths by using the start time of the route.

The Feature Layer differs between three classes with different waiting time ranges.


<Theme id="PTV_TruckWaitingTimes">
  <OverlappingResolution scope="ALL_THEMES" forceDisplay="false" maximumDisplacement="0"/>				
<!--- definition of displayed icons for each display class, icons are placed in the bitmap directory which is defined in xmap.properties -->
  <Class name="Waitingtimes-short">
    <Filter>
      <Condition displayClass="WaitingTime">
        <Range values="0-30"/>
      </Condition>
    </Filter>
    <Style>
      <Icon displayRange="9-16" url="./22x22/truck/truck_waiting_toll_short.bmp"/>
      <Icon displayRange="17-19" url="./24x24/truck/truck_waiting_toll_short.bmp"/>
      <Icon displayRange="20-23" url="./32x32/truck/truck_waiting_toll_short.bmp""/>
    </Style>
  </Class>
  <Class name="Waitingtimes-average">
    <Filter>
      <Condition displayClass="WaitingTime">
        <Range values="31-60"/>
      </Condition>
    </Filter>
    <Style>
      <Icon displayRange="9-16" url="./22x22/truck/truck_waiting_toll_average.bmp"/>
      <Icon displayRange="17-19" url="./24x24/truck/truck_waiting_toll_average.bmp"/>
      <Icon displayRange="20-23" url="./32x32/truck/truck_waiting_toll_average.bmp""/>
    </Style>
  </Class>
  <Class name="Waitingtimes-long">
    <Filter>
      <Condition displayClass="WaitingTime">
        <Range values="61-600"/>
      </Condition>
    </Filter>
    <Style>
      <Icon displayRange="9-16" url="./22x22/truck/truck_waiting_toll_long.bmp"/>
      <Icon displayRange="17-19" url="./24x24/truck/truck_waiting_toll_long.bmp"/>
      <Icon displayRange="20-23" url="./32x32/truck/truck_waiting_toll_long.bmp""/>
    </Style>
  </Class>
</Theme>
		

The ranges for the maximum waiting times can be set in the <Range values> tag. Note that the unit of this tag is in seconds. The representation of icons can be configured with the <Style> tag of a class. A DisplayRange is specified for each icon, i.e. a range of the zoom level at which icons sizes should be toggled bigger or smaller. By default, three icons (green, orange, red) ship with any PTV xServer in three different sizes (22px, 24px and 32px) to display truck waiting times.

The following table explains the classes with the regarding waiting times and icons:

ClassWaiting time
in seconds
Icon
Short0-30
Average31-60
Long61-600

Icons are always placed at the locations of toll booths. These points are given by the map provider and are integral parts of the PTV_TruckWaitingTimes Feature Layer. If a map does not support PTV_TruckWaitingTimes you will not be able to see any icons. Be also aware that a changed zoom level at DisplayRange can cause loss of performance!


Below you can find a JSON sample request which can be directly copied and put into the PTV xMap Server's Raw Request Runner to display truck waiting times on a map.





Displaying waiting times in Paris with the PTV xMap Server.