Displaying toll roads
This article explains how to visualize toll roads on a map. Note that the vehicle 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. attributes and the time dependency are not taken into account to display the toll roads; that means a road can be rendered as tolled even if it is free of charge for your vehicle or at the time you drive on it. Nevertheless the map may contain different sets of toll roads for example when it is already known that at some point in the future new roads will be tolled.
Benefits
This feature gives you the ability to see the toll roads and the toll locations.
Prerequisites
Check if the following prerequisites are fulfilled before you start with the use case:
- Installed and licensed PTV xMap Server
- Installed PTV Map containing toll data
- Installed and activated license key
toll
Programming Guide
When using the REST REST (Representational State Transfer) represents a World Wide Web paradigm, consisting of constraints to the design of components which results in a better performance and maintainability. API to build a tiled map, the REST operation tile is part of the following URL, by means individual tiles can be requested:
http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={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.}
Concrete values in URL template have to be defined for zoomlevel, x and y coordinates, specifying the map section of the corresponding tile.
To display toll roads on a map with common content, the parameter layers
has to be specified in the URL enabling all base layers
and toll.
http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profile}&layers=labels,transport,background,toll
To obtain a map which contains only toll roads, the parameter layers
has to be specified in the URL enabling only
toll.
http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profile}&layers=toll
With the request option timeConsideration set to SNAPSHOT it is possible to define a point in time for which the toll roads should be displayed.
http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profile}&layers=labels,transport,background,toll&timeConsideration=SNAPSHOT&referenceTime={referenceTime}
Example
In the example below, which is based on the one from
Displaying a Basic Interactive Map,
Toll roads are displayed on a tiled map using the Leaflet toolkit depending on the toll data detail level. The function determineTollLayer
sends a dataInformation
request and checks the toll detail level of the map. If there is detailed toll data available for at least some parts of the map, the toll layer is requested in addition to the other base layers.
Related Topics
The following topics might be relevant for this use case.
- Technical concept: Profiles
- Technical concept: Time Consideration
- Technical concept: Toll
- Integration sample: Displaying a Basic Interactive Map
- Showcase: Calculate Toll Costs