Creating and considering custom Feature Layers
This article discusses the use case of calculating a route 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
andcustomFeatureLayer
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
- Creating and considering custom Feature Layers blocking or opening roads
- Considering custom Feature Layers preferring, restricting or unrestricting roads
- Blocking a road to vehicles above a certain height
- Custom Feature Layer blocking roads including in a content snapshot
- Custom blocking with xRoute and xDima
- Custom blocking with xRoute and xDima using high performance routing
- Adding extra driving time to segments
- Apply absolute speeds to segments
- Add notes to segments
- Apply relative speeds to segments