High-performance Routing

This use-case describes how to retrieve meta information about the availability of high-performance routingClosed 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. networks and then shows how to use this information to calculate a route with high-performance routing networks.

Benefits

  • Using the xData API makes it easy to obtain the available high-performance routing networks.
  • Using the xRoute API makes it easy to obtain optimized routes based on minimal input.
  • Control and information over the routing type.

Prerequisites

Please ensure following prerequisites are fulfilled before you start with the use case:

  • Installed PTV xData service
  • Installed and licensed PTV xRoute service with an activated license key for highPerformanceRouting
  • At least one high-performance routing network

Programming Guide

The listHighPerformanceRoutingNetworks API is very flexible. Three sample applications are shown in the following.

The first sample shows how to select a high-performance routing network for an xroute request. This is especially useful if only a few parameters are relevant for your routing. The list of high-performance routing networks is filtered for networks that allow Luxembourg.

Before calculating a route, we retrieve the information about a high-performance routing network that covers Luxembourg by calling listHighPerformanceRoutingNetworks. The request we pass to calculateRoute for this task contains the list with our two waypointsClosed A waypoint is a geographic location used to specify start, destination and possible stopovers for a route., entities from the high-performance routing network like the request profileClosed The request profile is a partial profile provided in object form for a specific request. Any parameter which is not set in the request profile will be taken from the stored profile. and geographic restrictions, the result fields with the route report enabled to retrieve the routing type, and the route options specifying the routing type to high-performance routing. Once xroute has processed the request the callback routingCompleted is invoked accessing the result of the calculation in the form of a RouteResponse object.

The second sample shows how to use listHighPerformanceRoutingNetworks to query whether there is a high-performance routing network available for the current profileClosed 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.. This integration sample may take a moment as it may create a high-performance routing network in the beginning for demonstration purposes. Of course, this is cleaned up afterwards.

In the third sample it is shown how to use high-performance routing by setting the id of a high-performance routing network.

General notes

In this example we provide our waypoints A and B as x, y coordinates in the default EPSG:4326 format (see RequestBase.coordinateFormat). For A and B we use OnRoadWaypoint, see the technical concept on waypoints and route legs for more information on the different waypoints.

Please refer to the documentation of the RouteRequest for more information on request parametrization.