route_optimize_tsp
Optimize the visiting order of waypoints for traveling salesman routes using OSRM. Returns total distance, duration, and visit order; optionally adds route geometry to the project.
Instructions
Optimize the visiting order of waypoints (traveling-salesman-style) via OSRM's trip service.
waypoints is a list of [lat, lon] pairs (>= 3 - below that there's
only one order). roundtrip (default True) returns to the start; set
False for an open trip ending at the last waypoint. Returns total
distance/duration and visit_order (indices into the input
waypoints, in visiting order). Pass add_to_project=True to also add
the optimized route geometry as a line layer (EPSG:4326).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | car | |
| base_url | No | ||
| roundtrip | No | ||
| waypoints | Yes | ||
| layer_name | No | ||
| add_to_project | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||