Reverse Geocoding of Onboard Computer Data from Trucks

From Coordinates to Realized Location

Peter Hendriks
Data Solutions — part of Incentro
6 min read13 hours ago

--

Every day, numerous trucks travel our highways, transporting goods from point A to point B. These trucks are equipped with onboard computers, which generate large amounts of data during travel, including mileage, average speed, fuel consumption, and GPS location. This data can be translated into valuable insights.

For example, it can determine if and where a truck has stopped and what activities took place during this stop. This information is valuable for logistics companies, as it allows them to compare actual activities with planned ones, providing insights into how accurately and cost-efficiently trucks are operating.

In this blog, we illustrate through a customer case for Simon Loos how data from truck onboard computers is analyzed and converted into specific geographical locations, which are then identified as ‘Points Of Interest’ (POI). We focus on the concept of reverse geocoding, a technique that allows deriving a specific address from raw coordinates.

What Does the Journey from Coordinates to Realized Location Look Like?

Collecting Onboard Computer Data

The process starts with collecting all coordinates from the truck onboard computers. These coordinates serve as the basis for the following steps described below.

Steps:

  1. Receive onboard computer data via the onboard computer API called Trimble.
  2. Transform onboard computer data into Trace objects.
  3. Define stops based on the Trace objects.
  4. Publish the defined stops to the next PubSub topic.
  5. A message is received in the location service via PubSub, containing the stop with the associated Trace data.

“At this point in the process, the ‘stop’ activities are defined, each provided with detailed and descriptive information.”

Reverse Geocoding and H3

For the Traces corresponding to the defined stops, it must be determined at which (interesting) location these occurred. These location details, including the address, are stored in a database to create a clear overview of where the trucks have actually been.

The process determines the locations of each Trace using the H3 framework, a geo-indexing system developed by Uber Engineering. This system divides geographical data into hexagonal segments at different precision levels, ranging from global to local. Each segment, or ‘hexagon,’ receives a unique Hexagon ID (H3ID) that determines the exact global location. Each Trace thus also gets an H3ID.

Example:

This framework ensures that groups of coordinates close to each other receive the same H3-ID, creating an overview of all locations where the trucks have been.

Why Choose the H3 System?

The ultimate goal is to automatically assign an address to each Trace based on location. The reverse geocoding API, JOpenCage, an open-source option that is relatively cost-effective compared to alternatives like Google Maps, is used for this purpose.

Direct use of raw coordinates from the Traces in JOpenCage would provide high precision in determining the truck’s location but would lead to an enormous number of requests, resulting in significant costs.

H3 allows linking a coordinate to an H3ID. This process somewhat reduces the precision of location determination and groups the coordinates within that hexagon under one common denominator: the H3ID.

By consciously choosing less precision and grouping the coordinates under an H3ID, significant costs are saved while still maintaining enough precision to determine the location of the realization. The hexagon associated with the H3ID has a central coordinate that can then be used to find an address using JOpenCage.

This central coordinate is stored in the database with the location data of the Trace and is used as a reference table for future incoming coordinates. If these are already known in the database, a new request via JOpenCage for the same address is not necessary.

Here is a visual representation of the entire process:

How Does JOpenCage Work?

The JOpenCage API requires a coordinate and the API Key in the request URL and will return the nearest address with associated metadata in a JSON format.

Demo request URL including coordinate:

https://api.opencagedata.com/geocode/v1/json?q=%3Ccoordinaat%3E&key=6d0e711d72d74daeb2b0bfd2a5cdfdba&language=nl&pretty=1

Example Output:

Below is an example of the address component of the test URL output where the formatted value is particularly interesting as it represents the full address:

"components" : {
"ISO_3166-1_alpha-2" : "DE",
"ISO_3166-1_alpha-3" : "DEU",
"ISO_3166-2" : [
"DE-NW"
],
"_category" : "building",
"_type" : "building",
"city" : "Munster",
"city_district" : "Münster-Mitte",
"continent" : "Europe",
"country" : "Germany",
"country_code" : "de",
"house_number" : "7",
"neighbourhood" : "Josef",
"political_union" : "European Union",
"postcode" : "48153",
"road" : "Friedrich-Ebert-Straße",
"state" : "North Rhine-Westphalia",
"suburb" : "Innenstadtring"
},
"confidence" : 10,
"formatted" : "Friedrich-Ebert-Straße 7, 48153 Munster, Germany",
"geometry" : {
"lat" : 51.9526599,
"lng" : 7.632473
}

Based on the obtained address, it is checked in the database whether a POI (Point Of Interest) is already known. If found, the POI is expanded with the new H3ID. If no POI can be found, a new POI is created. After updating the POI table, a realized location is created for each Trace, in combination with the associated POI. This product contains data about the locations where the truck has been (POI data) combined with the times when this happened (Trace data).

After all these steps, the process is complete. Onboard computer data has been collected from the trucks, transformed into Trace objects, enriched with address data based on geodata, and new data points, called realized locations, have been created. These realized locations serve as input for further business analysis.

How is All This Exactly Used?

Within the project, the realized locations are used, among other things, to link them to planning data. This allows the evaluation of how accurate the plans are compared to what actually happens based on the data.

For example, suppose Driver A is scheduled to load and unload between 12:00 PM and 1:00 PM at Albert Heijn in Breda. Based on the onboard computer data, it can be verified whether the driver was indeed at that location within the specified timeframe.

This process saves the organization a lot of time that would otherwise be spent manually checking the consistency between plans and actual realizations.

Summary

The blog describes how onboard computer data from trucks is used to gain insight into the actual locations and activities of the vehicles compared to the planned routes and stops. This process starts with collecting data such as GPS coordinates, which are then transformed into Trace objects and analyzed to identify ‘stops.’ Using Uber Engineering’s H3 framework, these locations are categorized into hexagonal segments to manage geographical data more efficiently. Through reverse geocoding, specifically with the JOpenCage API, these coordinates are converted into specific addresses.

Recommendation

This system enables logistics companies to evaluate and improve the accuracy of their schedules by comparing realized stops with planned stops. Identifying Points Of Interest (POI) also helps analyze driver behavior and provide accurate delivery time forecasts to customers. Choosing the right geocoding API is crucial for the accuracy, speed, and cost-effectiveness of the entire process, ultimately contributing to the optimization of logistics operations and leading to improved efficiency and cost savings.

FAQ

What are the benefits of identifying Points Of Interest (POI) from truck data?

Identifying Points Of Interest (POI) from truck data offers multiple benefits. It helps logistics companies evaluate the efficiency and effectiveness of their routes and schedules by comparing actual stops with planned stops. It also provides insights into driver behavior, such as unplanned stops or route deviations. Additionally, this data can be used to provide customers with more accurate delivery time forecasts and to develop better strategies for future logistics operations.

How can reverse geocoding improve business operations?

Reverse geocoding can improve business operations by converting location coordinates into readable addresses, helping companies better understand where their activities take place. This can improve customer service by providing accurate updates on the status and location of deliveries. It can also provide insights into loading and unloading patterns and help optimize routes to reduce fuel consumption and delivery times.

Why is choosing the right geocoding API important?

Choosing the right geocoding API is crucial because the accuracy, speed, and cost of the geocoding service directly impact the quality and economic efficiency of the entire data processing process. A good geocoding API delivers accurate and consistent results and is scalable to handle large volumes of requests at reasonable costs. This ensures reliable location data that businesses can trust for their decision-making processes.

References

Author: Robin Vermeulen

Connect with us: www.incentro.com

Direct contact? Erwin.schoonderbeek@incentro.com

--

--