Creating and considering custom Feature Layers

This article discusses the use case of calculating a routeClosed A route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. by taking into account a custom Feature Layer.

Benefits

Create your own custom Feature Layers to modify road attributes, create your own restrictions or to favor certain roads and thus affect the route planning.

Prerequisites

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

  • Installed and licensed PTV xRoute, xData and xMap service.

  • Installed map includes Luxembourg by HERE.

  • A valid license for the keys customFeatureLayerManagement and customFeatureLayer

Concepts

A custom Feature Layer can be created and used for route planning to overwrite road attributes in the map.

To create a custom Feature Layer, road segments together with the desired attributes have to be provided to the createFeatureLayer operation.

To identify such road segments, one of the getSegments operation can be used. These operations return the segments ids which correspond to the chosen selection operator (segment(s) nearest to a point, segments intersecting a polyline, segments surrounded by a polygon).

Then, in order to define the new feature, users have to fill key/value in the Feature Layer attributes field with properties available in the PTV_RoadAttributes theme.

Restrictions

In the following examples, a temporary custom Feature Layer is created and used. Such a layer is limited in its size. To overcome this restriction, it is possible to create a persistent custom Feature Layer.

Programming Guide

Related Topics