Custom Feature Layers can be created in order to consider user-defined information during the 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. calculation.
Custom Feature Layers can be used to :
- Block or open certain roads
- Prefer or avoid certain roads, depending on their user-defined class
- Prohibit roads to vehicles The term vehicle describes what is being routed or planned for. Vehicles are used in route calculation, distance matrix calculation and effectively also in tour planning. In route calculation, vehicle properties like overall size, weight and speed are in focus. In tour planning, it is vehicle properties like capacity and availability. Commonly a vehicle is motorized, like a truck - including its trailer or a car. However also a bike or even a pedestrian are included in this definition. above certain dimensions or weight
- Add an extra driving time on segments
- Change the absolute speed of segments
- Add descriptions for the applied changes
- Change the relative speed of segments
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.
Several kinds of uses can be made and some integration samples are given.
- Users can block some road segments or open them (ex: open one-ways). Note that, opening a road resets bonus or malus that is possibly inherited from the profile A profile is a collection of parameters used to configure the request. Full profiles consist of a number of specialized sub-profiles like the VehicleProfile which describes the properties of a vehicle. or from a Feature Layer of the map.
- Users can create custom road classes (CUSTOM_ROAD_CLASS_1 to CUSTOM_ROAD_CLASS_5) and use them to prefer or avoid some roads. The users can choose:
- preferredRouteTypes: if the road class must be preferred by the routing algorithm.
- unrestrictedRouteTypes: if the road class should be unrestricted despite of the presence of others Feature Layers. For the corresponding segments, the Feature Layers from the map (e.g. TruckAttributes) will be ignored.
- restrictedRouteTypes: if the road class should be avoided as far as possible, e.g. for convenience reasons.
- highlyRestrictedRouteTypes: if the road class must be avoided, e.g. due to legal limitations.
- Users can prohibit segments of roads depending on dimensions of vehicles.
- Users can add extra driving time on segments.
- Users can set the absolute speed on segments.
- Users can add a note on segments.
- Users can set a relative speed on segments.
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.
As binary object, the encoded representation of the Feature Layer is provided in FeatureLayerResponse. Thus, it is only available for the caller and nothing is saved on the server-side. The caller can provide this object in a xRoute request with RouteOptions.binaryFeatureLayer , or in a xDima request with DistanceMatrixOptions.binaryFeatureLayer.
The size of a Feature Layer binary object cannot exceed 20 000 road segments with the default configuration in order to limit the size of the responses. However, it is possible to increase this value changing the server configuration file (see Server Configuration page) or to create several Feature Layers. Furthermore, it is not possible to use a binary object with CreateHighPerformanceRoutingNetworkRequest, and createContentSnapshot . Also, it is not possible to render a custom Feature Layer as binary object with the PTV xMap service.
As persistent layer, the Feature Layer is stored as a file under the path "data/flr". When creating a custom Feature Layer, users must specify a unique scenario name. The scenario name is the layer identifier; this is the name that will appear in the User Data Monitor when listing custom Feature Layers or that must be filled in the featureLayerProfile to be used by the other operations, if the PTV_RoadAttributes theme is activated. Note that the complete path folder of a scenario is “data/flr/tenant/scope”. Please note that it is possible to create Feature Layers with a same scenario name but located in different scopes.
More details about the tenant and scope can be found on this technical concept.
Contrary to binary object, there is no size limitation, and all operations can use the persistent layer.
Licenses and Managing custom Feature Layers
- CreateFeatureLayer requires an activated license key
- Listing: It is possible to list all available custom Feature Layers with the operation listFeatureLayers. The user data monitor of the xServer dashboard uses this operation to show the available Feature Layers.
- Removal: A custom Feature Layer can be deleted using the operation deleteFeatureLayer. This delete operation for custom Feature Layers requires an activated license key
- Please note that it is not possible to edit an existing Feature Layer. If a modification has to be made, then the whole Feature Layer must be generated again.
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.
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.
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 transport 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.
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.
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.
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||Time Domains|
|Integration Sample||Creating and considering custom Feature Layers|
|Showcase||Displaying custom blockings|