Decoded

Using TomTom Maps APIs to Assist EV-Powered Food Delivery and On-Demand Services

Developer Portal
Jan 28, 2022 • Last edit on Jun 21, 20222 min read
Route on a TomTom map showing EV charging stops along the way.

Geocoding is the bedrock of any mapping or location management application, but many people don’t really know what “geocoding” means.

At its most basic, geocoding is just a search. It’s the process of taking the description of a location — an address, or a store name, or maybe just a keyword like “pizza” – and returning the latitude, longitude, and related metadata for any locations matching the search terms.

Mapping software can highlight those specific locations on a map display using those latitude and longitude values. That might mean showing all takeout pizza shops within a 5-minute walk, or it might tell a delivery driver where to deliver pizza after a customer has placed an order.

And with those map pins, a location-enabled app can help food services find the nearest delivery driver, have them pick up the pizza, and route them to the customer’s home or office to drop it off. It can even calculate an estimated time of arrival (ETA), so the customer knows when to expect a knock and a hot lunch, ready to eat.

More people, including delivery and on-demand service drivers, are adopting electric vehicles (EVs) for improved fuel economy, reduced maintenance, and environmental concerns. The International Energy Agency noted in its Global EV Outlook 2021, “After a decade of rapid growth, in 2020 the global electric car stock hit the 10 million mark, a 43% increase over 2019.”

In some regions, recharging locations are still more sparsely distributed than gas stations and sometimes tricky to find – they may be in the corner of a parking lot rather than at prominent road intersections. EVs need compatible charging stations, and there may be competition for available charging stations at a given place and time. Freelance drivers hoping to optimize their time on the road can gain a crucial advantage by using software providing timely, accurate information about driving range, charging time, and available charging locations.

What do search and routing have to do with EVs, then? EVs have unique location search and routing needs due to energy capacity and range challenges.

TomTom’s flexible APIs and SDKs help you build applications that run on-demand and mobility businesses such as ridesharing, food and parcel delivery, and more. And these solutions support both traditional internal combustion vehicles and tomorrow’s EV fleets’ unique needs.

In this article, we’ll examine some of the unique search and routing needs of EVs — particularly in the context of mobility and on-demand businesses — and the TomTom services you can use to build apps that meet those needs.

Search, Geocoding, and Routing

Location search – geocoding – is often the first step in any mapping or mobility application. This part of the application is broadly applicable to all vehicle types, whether internal combustion or EVs.

You might create an application that lets consumers find nearby stores, restaurants, or other businesses offering delivery services. Consumers search for “pizza” and get a list of nearby restaurants, displayed with pushpins on a map. Maybe touching the pushpin lets them place an order through the app.

A customer places an order and provides a delivery address. You built the store’s fulfillment application to search for and confirm the delivery address. Then it gives the address text to the delivery driver to recognize the street and number. It also provides the coordinates to display the address on a map. It might also include details such as which side of the road to park on and the location of an apartment building’s front door.

Your app also uses the delivery address’s geocoded coordinates to calculate an efficient route for the driver, taking into account information like real-time and historical traffic. You can even calculate the ETA and tell the customer when to expect their delivery.

As a developer, you might build this app using the Search API Category Search to optimize search around a certain kind of business, like restaurants. You might also use Geometry Search to limit results to a given delivery service area or Along Route Search to find points of interest (POIs) along a specified path.

The API response provides information about a point of interest (POI) for use in your app that includes everything from address, phone number, and website to nearby intersections and more.

1 "poi": {
2 "name": "Upper Crust Pizza & Pasta",
3 "phone": "+(1)-(831)-4762333",
4 "url": "www.uppercrustsc.com/",
5 "brands": [
6 {
7 "name": "Upper Crust"
8 }
9 ],
10 ...
11 "categories": [
12 "pizza",
13 "restaurant"
14 ],
15 "openingHours": {
16 "mode": "nextSevenDays",
17 "timeRanges": [
18 {
19 "startTime": {
20 "date": "2019-02-05",
21 "hour": 7,
22 "minute": 0
23 },
24 "endTime": {
25 "date": "2019-02-05",
26 "hour": 21,
27 "minute": 0
28 }
29 },
30 ...
31 "address": {
32 "streetNumber": "2501",
33 "streetName": "Soquel Dr",
34 "municipalitySubdivision": "Santa Cruz, Live Oak",
35 "municipality": "Santa Cruz, Live Oak",
36 "countrySecondarySubdivision": "Santa Cruz",
37 "countryTertiarySubdivision": "Santa Cruz",
38 "countrySubdivision": "CA",
39 "postalCode": "95065",
40 "extendedPostalCode": "950652023",
41 "countryCode": "US",
42 "country": "United States Of America",
43 "countryCodeISO3": "USA",
44 "freeformAddress": "2501 Soquel Dr, Santa Cruz, CA 95065",
45 "countrySubdivisionName": "California",
46 "localName": "Santa Cruz"
47 },
48 "position": {
49 "lat": 36.98844,
50 "lon": -121.97483
51 },

Once you have a destination – whether for a customer placing an order or reservation or a delivery location – you’d use the Routing API Calculate Route endpoint, which calculates a route from a location to an endpoint. You can then display this route to the driver. The API can also return travel time, ETA, and traffic information.

1 "routes": [
2 {
3 "summary": {
4 "lengthInMeters": 1147,
5 "travelTimeInSeconds": 161,
6 "trafficDelayInSeconds": 15,
7 "departureTime": "2015-04-02T15:01:57+02:00",
8 "arrivalTime": "2015-04-02T15:04:38+02:00",
9 "noTrafficTravelTimeInSeconds": 120,
10 "historicTrafficTravelTimeInSeconds": 157,
11 "liveTrafficIncidentsTravelTimeInSeconds": 161,
12 "batteryConsumptionInkWh": 0.155,
13 "deviationDistance": 1735,
14 "deviationTime": 127,
15 "deviationPoint": {
16 "latitude": 52.50904,
17 "longitude": 13.42912
18 },

Search and Routing for EVs

Sometimes a driver wants to find out about POIs at or near a given location. For EVs, a popular search is charging stations near the current location or along a route. Finding charging stations is an example of searching by category, rather than using the Search API and Fuzzy Search.

As with searching for an address or store name, category search returns the geocoded results for a type of location, such as fueling stations or charging stations. These results can feed other applications, such as routing and ETA, which deliver actionable information back to the user.

For EV-specific search applications, TomTom incorporated charging station search into their Search API. The API enables developers to integrate the following information into their applications:

  • Charging station location and availability
  • Charging station plug type and charge power compatibility

So, drivers can find the nearby, available, and compatible charging stations from your app. The concept of a reachable range is fundamental in EV, especially for food delivery, where accepting an order outside the vehicle’s reachable range would be disastrous. Reachable range refers to the distance an EV can travel without recharging, a vital consideration when drivers busily deliver orders across the city. The Routing API supports finding this information through the Calculate Reachable Range service.

The Calculate Route service discussed earlier accommodates optimized routes with given route types (the fastest, the most economical, one that avoids tolls, and so on). It also enables your app to specify engine type — fuel or electric — and incorporate EV consumption into your routes.

For example, you might have noticed this data point in the API response shown earlier:

"batteryConsumptionInkWh": 0.155,

The TomTom Routing API supports optional parameters for an Electric Consumption model that lets your app provide vehicle-specific power usage profiles to generate even more accurate and helpful routing details.

The Calculate Reachable Range endpoint can provide EV-specific routing information for your app, including limits to the vehicle’s range, based on given charge and consumption parameters.

If you’re building mobility and on-demand focused applications, the reachable range capability helps ensure drivers only volunteer for reachable locations. This information enables drivers to optimize vehicle use while considering service commitments.

Another helpful feature for route planning is the ability to configure API route requests that specify fuel economy. The Routing API services enable selecting an “eco” route type. Combined with a detailed Electric Consumption model, vehicle weight, and other details, you can help users predict travel time and the amount of energy needed.

Wrapping Up

The introduction of EV changes the requirements for food delivery and other on-demand delivery or ridesharing applications. Fuel economies provided by EVs, coupled with the increasing popularity of last-mile services, are driving new business opportunities. These factors are also introducing new levels of complexity to freelance drivers, who must consider the specific issues associated with recharging EVs to achieve their service commitments.

Applications must present new factors such as reachable range to advise the driver. These applications must incorporate the data to support analyzing these ranges to address EV challenges.

These complexities create new opportunities for application development. TomTom’s APIs and SDKs offer developers the tools they need to incorporate EV location management into their on-demand and delivery applications. For more information, visit the TomTom Developer Portal and sign up for your free access today.

To learn more about EV-related topics, check out these articles:

Happy mapping!

Get the developer
newsletter.

No marketing fuff. Tech content only.
Thanks for contacting us

We will reach out to you soon.
Blog cards
tomtom tech news