Using TomTom Maps APIs to Assist EV-Powered Food Delivery and On-Demand Services
TomTom Developer Portal·Jan 28, 2022

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

TomTom Developer Portal
TomTom Developer Portal
Jan 28, 2022 · 8 min read

Food delivery drivers and on-demand services are adopting electric vehicles, despite challenges finding chargers and delivering within range. Developers can use TomTom Maps APIs to create on-demand apps, helping drivers optimize their EV use and quickly get items to their destination. Learn how.

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.

 "poi": {
    "name": "Upper Crust Pizza & Pasta",
    "phone": "+(1)-(831)-4762333",
    "url": "www.uppercrustsc.com/",
    "brands": [
      {
        "name": "Upper Crust"
      }
    ],
    ...
    "categories": [
      "pizza",
      "restaurant"
    ],
    "openingHours": {
      "mode": "nextSevenDays",
      "timeRanges": [
        {
          "startTime": {
            "date": "2019-02-05",
            "hour": 7,
            "minute": 0
          },
          "endTime": {
            "date": "2019-02-05",
            "hour": 21,
            "minute": 0
          }
        },
        ...
 "address": {
    "streetNumber": "2501",
    "streetName": "Soquel Dr",
    "municipalitySubdivision": "Santa Cruz, Live Oak",
    "municipality": "Santa Cruz, Live Oak",
    "countrySecondarySubdivision": "Santa Cruz",
    "countryTertiarySubdivision": "Santa Cruz",
    "countrySubdivision": "CA",
    "postalCode": "95065",
    "extendedPostalCode": "950652023",
    "countryCode": "US",
    "country": "United States Of America",
    "countryCodeISO3": "USA",
    "freeformAddress": "2501 Soquel Dr, Santa Cruz, CA 95065",
    "countrySubdivisionName": "California",
    "localName": "Santa Cruz"
  },
  "position": {
    "lat": 36.98844,
    "lon": -121.97483
  },

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.

 "routes": [
    {
      "summary": {
        "lengthInMeters": 1147,
        "travelTimeInSeconds": 161,
        "trafficDelayInSeconds": 15,
        "departureTime": "2015-04-02T15:01:57+02:00",
        "arrivalTime": "2015-04-02T15:04:38+02:00",
        "noTrafficTravelTimeInSeconds": 120,
        "historicTrafficTravelTimeInSeconds": 157,
        "liveTrafficIncidentsTravelTimeInSeconds": 161,
        "batteryConsumptionInkWh": 0.155,
        "deviationDistance": 1735,
        "deviationTime": 127,
        "deviationPoint": {
          "latitude": 52.50904,
          "longitude": 13.42912
        },

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 fluff. Tech content only.

* Required field. By submitting your contact details to TomTom, you agree that we can contact you about marketing offers, newsletters, or to invite you to webinars and events. We could further personalize the content that you receive via cookies. You can unsubscribe at any time by the link included in our emails. Review our privacy policy.