Custom Feature Layers



Custom Feature Layers can be used to :

Detailed Consideration

Creating and using custom Feature Layers

The operation to create a custom Feature Layer is createFeatureLayer provided by the PTV xData service.

The resulting custom Feature Layer can be used by several PTV services: by xRoute to calculate routes, by xDima to create a distance matrix, and by xData to create a high-performance routing network or a content snapshot. It can be also rendered on the map by xMap when the layer is persisted on the server.

Retrieving the relevant segmentIds is a step that must be performed beforehand. The operation is explained in the Accessing Data technical concept. For each created Feature, it is possible to define as key/value, via a Feature Description, the attributes values. The list of attributes that can be used are documented in the PTV_RoadAttributes theme.

Schema illustrating the Feature Layer creation and usage process

Several kinds of uses can be made and some integration samples are given.

For all kinds of uses Time Domains could be used for scheduled the custom Feature Layers. It is quite possible to build a restriction for only certain hours of the day, or a few days of the week. For example, a route hosting a market is opened for shopkeeper according to a legally regulated schedule that the custom Feature Layers allow to consider.

createFeatureLayer offers the possibility to either return a binary object which can be used in subsequent requests, or to directly persist the custom Feature Layer on server-side.

Licenses and Managing custom Feature Layers

Good to know

Supported Feature Layer themes

Only one Feature Layer theme is currently supported for custom layer generation: PTV_RoadAttributes.


The property opening open the one-ways or the blockings from PTV_TruckAttributes or PTV_Restriction_Zones. But it does not "open" PTV_General_Truck_Restrictions or PTV_TrafficIncidents.


Contrary to the opening property, one-ways are kept unchanged.

Absolute speeds

The speeds interval accepted is between 0 and 254 km/h. An absolute speed of 0 km/h should block the road. It is not checked if the absolute speed applied to a segment exceeds any legal limits.

If a feature contains an absolute speed property, then this feature must not contain other properties.


Can be a custom string. Does not influence the routing but can be combined with any other property to provide a description for other users.

Relative speeds

The relative speed corresponds to a percentage to apply on the speed value. The value accepted is between 0 and 254.
A percentage below 100 decreases the speed. A percentage above increases the speed. And 100% changes nothing.
A percentage of 0 blocks the road. It is not checked if the absolute speed applied to a segment exceeds any legal limits.

Road segments only

It is only possible to apply custom Feature Layer on road segments. Therefore, it is not possible to use custom feature Layers on combined transportClosed The combined transport is a form of transport where the vehicle in question does not drive itself but is transported by a boat or by rail (piggyback). segments (boat, rail).

Combinability of Themes

Custom Feature Layers can be used in combination with Feature Layers provided by PTV. All the layers can be combined, individually selected, and prioritized using the same conflict-handling mechanisms. For a client-side request one can define which layers have to be taken in consideration, and how. By default, custom Feature Layers are settings with a higher priority, but note that General Truck Restrictions or Traffic Incidents will not be affected by the opening operation.

Segments Direction

Features can have a direction (see segmentDirections).

  • When BOTH is selected, restrictions will be applied in both sides of the segment.
  • When POLYLINE_DIRECTION is selected, restrictions will be applied in the digitalization side of the segment. When segment is a one-way street, digitalization is in the driving side. The digitalization direction corresponds to the direction of the polyline coordinates contained in the getSegments() response.
  • When REVERSE_POLYLINE_DIRECTION is selected, behavior is the opposite of the POLYLINE_DIRECTION value.
The digitalization direction is shown with the dark narrows.

Data Compatibility

Custom Feature Layers are map-dependent. Indeed, the segmentIds are not the same according to the map versions. When changing maps, users will have to update their custom Feature Layers. To do this, it is advisable to store the segmentIds described in Accessing Data technical concept in order to have the possibility to regenerate custom Feature Layers.

Time-dependent restrictions

It is possible to create time-dependent restrictions. For that, GDF Time Domains are used.


There are no automated clean-up mechanisms, therefore please remove obsolete layers.

Technical Concept Feature Layer basics
Technical Concept Feature Layer attributes
Technical Concept Accessing Data
Technical Concept PTV_RoadAttributes
Technical Concept Multitenancy
Technical Concept Time Domains
Integration Sample Creating and considering custom Feature Layers
Showcase Displaying custom blockings