Page 1 of 1

Visualization of trips returned by XTour

Posted: Tue Mar 17, 2020 9:25 am
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.

Re: Visualization of trips returned by XTour

Posted: Tue Mar 17, 2020 9:55 am
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