Route
Planning routes for EVs comes with unique challenges. Factors like battery capacity, real-world energy consumption, topography, weather, and charging network availability all determine whether a vehicle will reach its destination.
The Routing service considers all these variables to find optimal EV routes. Using a world-class energy consumption model, it automatically places charging stops exactly when and where they’re needed. Need additional business rules to be taken into account? Routes are fully customisable, allowing you to fine-tune routes to suit your specific business needs and goals.
Use cases
- Trip planning: Integrate route and charging planning into consumer-facing applications to eliminate range anxiety and provide a worry-free routing experience to EV drivers. Eliminate the need for drivers to second-guess routes and charging locations.
- Maximize station utilization: Direct traffic to preferred charging networks using operator preferences. This enables eMSPs and CPOs to steer users toward self-owned or partner-owned stations, supporting loyalty programs and commercial agreements without compromising the route viability.
Implementation
To ensure high performance, the Route API operates asynchronously. This means that the creation and retrieval of the route happen in separate operations.
1. Route creation
Initiate a calculation using the createRoute mutation. You provide an input containing the vehicle settings, waypoints, and preferences. The operation returns a unique id. This ID is a reference used to retrieve the route.
2. Route retrieval
Use the ID to monitor the route creation status and, once ready, retrieve the route details. This can be done in two ways:
- Subscription (Recommended): The
routesubscription provides real-time updates on the route creation status and automatically pushes the route details as soon as they become available, eliminating the need for polling. - Query: The
getRoutequery allows you to fetch the route details on demand. Best used for re-fetching a previously calculated route.
Errors or route not found
If a route is not found or the calculation finds errors, the final status resolves to either not_found or error.