Technical Concepts > About FeatureLayer

About FeatureLayer

The FeatureLayer technology expands the routing network with new data content, and enables the processing of large amounts of data that decisively affect route planning.

To handle different kind of additional routing relevant information, the technology allows the definition of multiple layers. Each of these layers carries information which is important for and has influence on routing. The layers can be combined, individually selected and prioritized. Conflict-handling mechanisms ensure that more important layers (e.g. preferred routes) have a stronger impact on routing than layers with lower priority (e. g. restriction zones). The FeatureLayer can be controlled with the snippet mechanism. This means that with only a few parameters, a client-side request defines which layers are to be considered, and how (e.g. prioritization of several layers).

The data can be provided as

FeatureLayer technology is available for some PTV xServer:

PTV FeatureLayerRoutingRendering
Time Zones FLPTV xRoute ≥ 1.17
PTV xTour, xDima, xCluster ≥ 1.18.1
N/A
Preferred Routes FLPTV xRoute ≥ 1.17
PTV xTour, xDima, xCluster ≥ 1.18.1
PTV xMap ≥ 1.18.1
Truck Restriction Zones FLPTV xRoute ≥ 1.18.1
PTV xTour, xDima, xCluster ≥ 1.18.1
PTV xMap ≥ 1.18.1
Traffic Patterns FLPTV xRoute ≥ 1.17
PTV xTour, xDima, xCluster ≥ 1.18.1

PTV xMap ≥ 1.18.1

Truck Attributes FLPTV xRoute, xTour, xDima, xCluster 1.20PTV xMap ≥ 1.20
Traffic Incidents FLPTV xRoute, xTour, xDima, xCluster 1.20PTV xMap ≥ 1.20
For more information about the migration of the old properties configuration of PTV xRoute-, xTour-, xDima Server see Unified Profile Mechanism.

PTV FeatureLayer

Static FeatureLayer

Dynamic FeatureLayer

Dynamic FeatureLayer contains additional dynamic content which can be automatically downloaded by PTV Content Update Service (see Configuration of Dynamic FeatureLayer). To activate this service please contact your PTV sales representative.
Typical examples for dynamic FeatureLayer are:

Licensing

Each FeatureLayer theme must be licensed separately by the license key xroute.featureLayerThemes. For further information, please contact your PTV representative.

Benefits

These are the benefits of FeatureLayer.

Theoretical Concept of FeatureLayer Activation

A PTV FeatureLayer Theme is the logical content within a FeatureLayer.

Each type of FeatureLayer is represented by its theme and can be identified by an id string. Data files belonging to a certain FeatureLayer theme have a file name that contains the id of the corresponding theme. The FeatureLayer data is a set of additional road network attributes, that takes effect under specific circumstances. These circumstances can be described with settings for countries, rules, actions, and properties. The user can modify the circumstances by enabling or disabling some countries, rules, actions, or properties.

The circumstances are defined by the theme rules, which evaluate one or several theme properties, taking into account the attributes of the selected vehicle profile. For example, a road a may be forbidden to vehicles exceeding the totalPermittedWeight property value stored in the layer for this road. When all the conditions of a rule are fulfilled it triggers an action which can effect the routing (apply a bonus or malus to a road segment, change its speed, et cetera).

The GlobalSettings element in the FeatureLayer profile defines the general behavior of FeatureLayer. For example, all time dependent data can be disabled using the enableTimeDependency attribute, and generic parameters (described by name and value) can be defined for advanced configuration of the FeatureLayer data.

The theme specific configuration is located below the element Themes in the FeatureLayer profile. Each theme is characterized by its id. There is a prioritization for the themes which can be set with the priorityLevel attribute. Layers with a higher priority level will be considered first in case of conflicting information between different FeatureLayer. The elements have the following hierarchical structure in the profile:

Theme -> Country -> Rule <-> Action <-> Property

A list of available properties and rules for each FeatureLayer theme can be found in the FeatureLayer Content Documentation.

Configuration of FeatureLayer Themes

Each FeatureLayer theme is characterized by its id. If a theme is enabled, all of its sub-elements are implicitly enabled (see theoretical concept for more details).

A theme consists of the following elements:

Elements and attributes of a theme:

priorityLevel attribute

A prioritization for the themes can be handled by setting the priorityLevel. Legal values for the priority level are positive integer values. A higher value indicates a higher priority. The default priority level is 100.

Country element

The Country element defines specific settings for a country of this theme. The id can have the following values:

The following example enables PTV_SpeedPatterns only for Germany (country unit code 49)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Profile>
<FeatureLayer majorVersion="1" minorVersion="0">
<GlobalSettings enableTimeDependency="true"/>
<Themes>
<Theme id="PTV_SpeedPatterns" enabled="true">
<Country id="*" enabled="false"/>
<Country id="49" enabled="true"/>
</Theme>
</Themes>
</FeatureLayer>
<Routing majorVersion="2" minorVersion="0">
<Course>
<AdditionalDataRules enabled="true"/>
</Course>
</Routing>
</Profile>

For each country, the following elements can be filtered: properties, rules, and actions. Disabling these elements should be done carefully because they effect the routing results.

The available properties, rules, and action types depend on the layers that have been added to the map.

Basic Configuration of Static FeatureLayer

To enable or disable FeatureLayer functionality in general, set the attribute enableRoadEditor in the PTV xRoute configuration file conf/xroute.properties to true or false, respectively. In order to use FeatureLayer data, additional data rules have to be enabled in the profile:

<Routing majorVersion="2" minorVersion="0">
  <Course>
    <AdditionalDataRules enabled="true"/>
  </Course>
</Routing>

None of the FeatureLayer themes are activated by default. Each theme has to be activated separately by adding it to the global list of themes in the profile and by explicitly enabling its functionality.

<FeatureLayer majorVersion="1" minorVersion="0">
  <Themes> 
    <Theme id="PTV_PreferredRoutes" enabled="true"/>
  </Themes>
</FeatureLayer>
Basic example

This example illustrates a basic usage of the FeatureLayer PTV_SpeedPatterns. The XML snippet below is valid and can be passed to the PTV xRoute Server using the CallerContext property ProfileXMLSnippet.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Profile>
  <FeatureLayer majorVersion="1" minorVersion="0">
    <GlobalSettings enableTimeDependency="true"/>
    <Themes>
      <Theme id="PTV_SpeedPatterns" enabled="true"/>
    </Themes>
  </FeatureLayer>
  <Routing majorVersion="2" minorVersion="0">
    <Course>
      <AdditionalDataRules enabled="true"/>
    </Course>
  </Routing>
</Profile>

Configuration of Dynamic FeatureLayer - PTV Content Update Service

The PTV Content Update Service provides polling and downloading of dynamic FeatureLayer and toll updates. The data will be downloaded from a Layer Delivery Server. For the configuration and use of static FeatureLayer, see general FeatureLayer information.

Time Dependent FeatureLayer

Some FeatureLayer themes contain time dependent data, for example PTV_SpeedPatterns. The use of time dependent data can be enabled by setting the attribute enableTimeDependency of the element GlobalSettings to true.

Any time information from the data refers to the local time of the segment. That means, time zone information has to be considered for route calculation. Therefore the FeatureLayer PTV_TimeZones is required for the use of time dependent FeatureLayer themes and should be provided with the map data. The time zone information will be used implicitly, that means it does not require any additional license key or configuration. If a required PTV_TimeZones layer is missing, the route calculation will result in an error.

Due to the fact that the information is used implicitly, no time zone information will be displayed as FeatureDescription in the route list (also see paragraph Feature descriptions in the route list). In order to show time zone information in the route list, the theme PTV_TimeZones has to be enabled explicitly.

Obtain Feature Descriptions in the Route List (sample PTV xRoute Server)

In order to obtain information about the FeatureLayer data within the route list segments, use one of the routing methods with the following adaptions:

  1. Set the attribute featureDescriptions in ResultListOptions to true.
  2. Set the CallerContext property ProfileXMLSnippet to

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>    
    <Profile xmlns:ns2="http://www.ptv.de/com/ptvag/xserver/engines/xpoidbaccess">
    <FeatureLayer majorVersion="1" minorVersion="0">
    <GlobalSettings enableTimeDependency="true"/>
    <Themes>
    <Theme id="PTV_SpeedPatterns" enabled="true"/>
    </Themes>
    </FeatureLayer>
    <Routing majorVersion="2" minorVersion="0">
    <Course>
    <AdditionalDataRules enabled="true"/>
    <DynamicRouting limitDynamicSpeedToStaticSpeed="false"/>
    </Course>
    </Routing>
    </Profile>
  3. Each route list segment contains a list of feature descriptions consisting of the following parts:
  4. Part Description Example
    ThemeID ID of the FeatureLayer theme. PTV_SpeedPatterns
    Description Available data for the current segment. freeFlowSpeed=40
    TimeDomain (optional) Information about the validity period of the data. Time domain documentation*

    * Note: the "fuzzy symbols" (e.g. z1) are not supported yet.

List FeatureLayer segment information without considering it

For evaluation purposes, it is possible to show information about FeatureLayer segment data along a route without considering it. This can be achieved by configuring a FeatureLayer theme but disabling all its actions, rules, or countries. Additionally, featureDescriptions have to be requested in the ResultListOptions element of the routing request.

The following snippet shows an example of how to display information about preferred routes in the route list without considering them:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Profile xmlns:ns2="http://www.ptv.de/com/ptvag/xserver/engines/xpoidbaccess">
<FeatureLayer majorVersion="1" minorVersion="0">
<Themes>
<Theme id="PTV_PreferredRoutes" enabled="true">
<Country id="*" enabled="false"/>
</Theme>
</Themes>
</FeatureLayer>
<Routing majorVersion="2" minorVersion="0">
<Course>
<AdditionalDataRules enabled="true"/>
</Course>
</Routing>
</Profile>

Usage of Inherited Profiles in the Context of FeatureLayer (sample PTV xRoute Server)

The consideration of FeatureLayer data for a route calculation can be achieved by referencing a specific XML profile or by adding an XML snippet to the request. This use case shows the XML snippet using the FeatureLayer theme PTV_PreferredRoutes. The PTV xRoute Server truckfast XML profile is set in the CallerContext property Profile and is therefore used as basic profile for the request. As described in the documentation of the XML profile mechanism an XML snippet solely considers the profile as parent that is set in the CallerContext.

This use case enables the FeatureLayer theme PTV_PreferredRoutes and configures a preferred route type:

Showcase: snippet usage

  1. Preconditions are met.
  2. Add a CallerContext property with key "ProfileXMLSnippet" to your routing request and use this XML profile snippet as value:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Profile xmlns:ns2="http://www.ptv.de/com/ptvag/xserver/engines/xpoidbaccess" >
    <FeatureLayer majorVersion="1" minorVersion="0">
    <Themes>
    <Theme id="PTV_PreferredRoutes" enabled="true">
    <PropertyValue id="preferredRouteType" value="1"/>
    </Theme>
    </Themes>
    </FeatureLayer>
    <Routing majorVersion="2" minorVersion="0">
    <Course>
    <AdditionalDataRules enabled="true"/>
    </Course>
    </Routing>
    </Profile>
  3. Set the CallerContext property Profile to truckfast.
  4. Send the request.

Usage of the XML Profile Parent Mechanism Instead of Snippets

To use the parent mechanism of XML Profiles explained in the Unified Profile Mechanism, the XML profile snippet mentioned above can be saved as child of the truckfast profile. To make sure that the PTV xRoute Server considers the profile correctly, it has to be saved in the profile folder (conf/profiles), for example under the name truckfast-preferredroutes.xml. To use the truckfast profile as parent profile, the attribute parent in the Profile element has to be set to truckfast. Now truckfast-preferredroutes can be used by setting it in the CallerContext property Profile.