Visualization of trips returned by XTour

This forum deals with any kind of trip optimization based on xTour1, xTour2 and the Developer APIs "RouteOptimization" and "SequenceOptimization". No matter whether it is automatic planning or manual dispatching, refering to transport orders or service planning.
Attention: this does not refer to PTV Optiflow SaaS and PTV Developer RouteOptimization Optiflow.
Post Reply
jakubkurchan
Posts: 5
Joined: Tue Mar 17, 2020 9:00 am

Visualization of trips returned by XTour

Post by jakubkurchan »

Hello

How can I obtain paths of the individual trips returned by XTour.planTours? I'm primarily looking for a polyline or list of coordinates that I can convert to polyline and display on Google Maps. Or perhaps xServer offers a way to display that? Of course I mean real path that goes on a road, not airline.
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Visualization of trips returned by XTour

Post by Bernd Welter »

Hello Jakub,

for the required feature you need to act as follows:
  • Use xTour to determine the tours, trips and stop sequences of the orders/locations. This will help you to get the proper sequence of (x,y) coordinates from each stop but not the detailed polygon line
  • Use xRoute2.calculateRoute and gather the detailed polygons of each partial trip or tour. This requires the resultfield.polyline=true. The RouteResponse object will then provide the polyline in a format specified by the RouteRequest.geometryOptions
  • FInally you can display the polygon lines on a mapping framework (xServer.NET for .NET developers, LEAFLET or OPENLAYERS for JavaScript developers, ...) in combination with a mapping engine (e.g. PTV xMapServer).
The step 2 is somehow optional: quite often dispatching user interfaces need to display the stop sequence but not necessarily the detailed route.
Both maps: same sequence of stops, both tour responses based on routing dima<br />Left: displayed with simple airline connection<br />Right: after polygon has been calculated via xRoute<br />Left:
Both maps: same sequence of stops, both tour responses based on routing dima
Left: displayed with simple airline connection
Right: after polygon has been calculated via xRoute
Left:
Does this answer the question?
Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply