Tour Planning
Problem: Twelve vehicles, sixty stops, appointment windows, capacity. Which vehicle goes where, in what order?Prerequisites
- A HERE API key or OAuth token with Tour Planning entitlement
export HERE_API_KEY="..."
The code
Both auth methods work. Drop the
Authorization: Bearer header and append ?apikey=<KEY> to the URL. This applies to all Tour Planning endpoints.The profile reference
This trips up nearly every first integration.
The async lifecycle
Unassigned jobs
Common mistakes
Approximating this with N routing calls. Slower, more expensive, worse routes. Settingprofile to a transport mode. It is a reference into fleet.profiles.
Leaving maxTime: 2 from the documentation example. Legal solution, unusable sequence.
Treating timeout as a failure. It means “raise maxTime.”
Ignoring unassigned. The solver told you.
Blocking an HTTP request on a synchronous solve. Use /async.
Constructing the status or solution URL. Use the returned href.
Losing statusId on restart. Resubmission bills again and returns a different sequence, confusing everyone downstream.
Leaving costs at example values. fixed is how you tell the solver whether adding a vehicle is cheap or expensive. That is a business decision.
Optimizing a truck fleet on car profiles. Infeasible sequences, confidently returned.
Re-solving on every inbound order. Route churn. Drivers stop trusting the app.
Production considerations
Solve on a cadence, not on every event. Nightly. Locked schedule. Exception-driven replanning only. A stable, 90%-optimal schedule outperforms a perfect one nobody follows. PersiststatusId before the first poll. The solve runs on HERE’s side regardless.
Hash the problem. Unchanged jobs, fleet, and constraints → reuse the solution.
Mid-day replanning is a new problem. Current vehicle location becomes the shift start; completed jobs are removed. Fresh submission, not an incremental update.
Service time estimates are your accuracy ceiling. Instrument actual versus estimated per job type. This improves schedules more than any solver parameter.
Tune maxTime and stagnationTime against real problem size. Measure the marginal improvement. Find the knee.
Truck fleets need truck profiles, with the same vehicle constraints as Truck Route.
Related
Tour Planning
VRP variants, costs, priorities, reloads.
Field Service
Skills, appointment windows, and why re-solving destroys trust.
Last-Mile Delivery
Where service time dominates travel time.
Distance Matrix
The cost table underneath — and the interface to your own solver.
HERE documentation
Need production HERE API keys or implementation support? Placematic is an official HERE Technologies reseller and implementation partner. Talk to us.