Route Locations, Waypoints and Route Legs
Characteristic
Short description | Route Locations
For all services based on 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 each location is represented by a RouteLocation.
The user can decide for each location how to be treated during route calculation. PTV xServer supports two types of route locations which basically control whether or not the location is part of the route:
- OffRoadRouteLocation
- OnRoadRouteLocation
Short description | Waypoints
From the PTV xRoute point we distinguish
- Input Waypoints
- Output Waypoints
Short description | Route Legs
Detailed Consideration
OffRoadRouteLocation
Things to consider |
|
---|---|
Typical use cases |
|
Use it if |
|
OnRoadRouteLocation
Things to consider |
|
---|---|
Typical use cases |
|
Use it if |
|
Input Waypoints
The PTV xRoute service has several input waypoints, see the entities that extend InputWaypoint. In particular, there is one input waypoint for each of the above described route locations, the OffRoadWaypoint and the OnRoadWaypoint - try the different behavior in the showcase Apply Different Waypoint Types.
Normally one input waypoint corresponds to one output waypoint in the response, see also the next section. There are three exceptions: on the one hand, a PathWaypoint generates multiple output waypoints, see also the technical concept on encoded path. On the other hand, a ManipulateRouteWaypoint and CombinedTransportViaWaypoint do not appear as output waypoints at all.
OffRoadWaypoint
The distance and traveltime from this waypoint to the road network is estimated and included in the response. For each OffRoadWaypoints, there is a corresponding waypoint in the response.
OnRoadWaypoint
Each OnRoadWaypoint add a corresponding waypoint in the response. Each corresponding OnRoadWaypoint is directly placed on the road network.
ManipulateRouteWaypoint
The route passes near the specified waypoint coordinate specified in the manipulateRouteWaypoint. A manipulateRouteWaypoint does not add a corresponding waypoint in the response. Moreover, it can't be neither the start or the end of a route, only a via waypoint.
CombinedTransportWaypoint
The route takes the specified 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). id. A combinedTransportWaypoint does not add a corresponding waypoint in the response. Moreover, it can't be neither the start or the end of a route, only a via waypoint.
Output Waypoints
The PTV xRoute service returns waypoints upon request. Such returned waypoints are called output waypoints. As mentioned in the previous section it is not guaranteed that there is an output waypoint for each input waypoint. The mapping from input to output waypoints can be done by a user defined ID. If such an ID is set at the input waypoint the corrsponding output waypoint contains this ID as a field.
Each output waypoint is of the type Waypoint which contains several calculated properties. These calculated properties are the distance from the user-defined input location to the geographically nearest point on the road network which is called the
linkedCoordinate
. The field linkTravelTime
refers to the linkDistance
divided by the field speedForLinkDistance
defined in the vehicle 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.. Note that for waypoints that correspond to an OnRoadWaypoint
in the request the linkTravelTime
is always 0 because the linkDistance
is not part of the route in this case. To mark the output waypoint on a map, the referenceCoordinate
can be used, as it is always part of the route.
Via Waypoints
In addition to the OffRoadWaypoint and OnRoadWaypoint described above, the PTV xRoute service offers other InputWaypoint types that can be used as Via waypoints to influence the route calculation according to some user preferences.
- ManipulateRouteWaypoint : This InputWaypoint type is used to attract the route around a certain coordinate within a user defined radius. this is particularly useful to prefer passing through a specified area instead of the default one.
- CombinedTransportViaWaypoint : This InputWaypoint type is used to force the route passage through the specified combined transport. For example, it can be used to prefer one ferry crossing over another.
Changing vehicle parameters at waypoint
For OffRoadWaypoint, OnRoadWaypoint and MultiCoordinateOnRoadWaypoint, it is possible to change some vehicle parameters.
This feature could be useful to get the best route which fits the current parameters of the vehicle. For example, the real weight, the number of trailers,...
For each waypoint, it is possible to change any of the VehicleParametersAtWaypoint. Please note that the changes are applied for all the next waypoints until there is another change or until the end of the route.
Be aware that, using this feature will have an impact on the performance.
Route Legs
A Route Leg can be identified by the IDs of its constitutive waypoints. It contains data like the travel time and distance needed for the leg, its polyline, and indices pointing to the segment and nodes lists.
Good to know
Empty Routes and Route Legs
NOT_DRIVING
.
A special case of an empty route leg is one that connects two different OnRoadRouteLocations which are linked exactly to the same point on the road network.
In all other cases when route legs between two different route locations are calculated the route leg consists of at least one "real" segment. Note, however, that also such a route leg may have a travel time or distance of 0 if the route locations are very close to each other.
Related Topics
Showcase | Apply different waypoint types |
Integration Sample | Calculating a route |
Technical concept | Encoded Path |