Best Practices for Geocoding
Geocoding is the process of getting an address’s coordinates (latitude and longitude). Most geocoding operations are performed by systems like APIs, as the accuracy and search speed requirements required for geocoding are beyond human capacity.
Geocoding uses two primary components: a location dataset and an algorithm that searches, filters, and performs all other relevant operations. When an end-user feeds an address into the system, the geocoding algorithm searches through the dataset using the parameters set and returns the coordinates.
One of the most common geocoding uses is fleet management and logistics. In this area, we use geocoding to determine the exact location of a vehicle to achieve real-time tracking. We can also use geocoding to determine when traffic congestion peaks on a certain route. We can then use this information to inform route efficiency and determine an ETA. Check out this link to learn more about TomTom geocoding in fleet management and logistics.
Though geocoding is effective and helpful in fleet management and logistics, there are some challenges we can face when trying to use it:
- Some locations aren’t covered in geocoding datasets. As a result, responses can be incorrect if the entered query is close to another location.
- Human error can occur while entering data into location datasets. This also extends to end users, who may enter addresses incorrectly (for example, with typos or missing letters) when searching for them. These mistakes may lead to inaccurate geocoding results.
In this article, we’ll explore best practices for geocoding more effectively with TomTom’s Geocoding API.
Geocoding with TomTom
TomTom has developed a Geocoding API that enables us to easily and accurately integrate geocoding functionality into our web and mobile applications. This API provides geocoding.
TomTom’s geocoding API uses two endpoints: Geocode and Structured Geocode. Geocode is used for freeform search, while Structured Geocode is used for structured search. To geocode, we first feed in our address with the parameters documented in the API Explorer. After processing, the responses returned primarily contain a summary object and a results array.
As the names suggest, the summary object contains summary details about the search performed. These details can include the time taken to perform the search, the number of results returned, and similar information. The results array contains a list of the returned coordinates for the Geocoding service and human-readable addresses for the Reverse Geocoding service. The list is sorted in descending order using the score metric. The score metric is applied to the result of the query. The larger the score, the higher the probability that a result meets the query criteria.
Geocoding Best Practices
Get Enough Information
While this may seem obvious, the accuracy of the returned results depends heavily on obtaining sufficient information. Trying to geocode ambiguous addresses that lack relevant details is unlikely to produce constructive results.
In the development process, we may overlook this and assume our geocoding service will account (and compensate) for the missing data. The most surefire way to ensure accurate results is to obtain substantial information about our POI.
We want our automated systems to function as reliably as possible, so we need to ensure that our process includes retrieving as much relevant data as possible to ensure that our geocoding has the best chance of sustained success.
Use Structured Search
Using structured search entails providing the address of the POI in structural format rather than as a single string. For example, we list the municipality in one input element, the street name in another element, and so on. This differs from a freeform search, in which we enter all details in one string.
When we have the full address, using structured search increases the likelihood of obtaining the correct coordinates. This approach helps the geocoding algorithm perform a fine-grained search for us. Fortunately, the process is straightforward.
To perform a structured search in TomTom’s Geocoding API, click the down arrow of the second endpoint under the Geocoding section. The interface will then display sections where we can key in the structured addresses, as shown in the image below:
Automate with Care
Geocoding works best when combined with automation, but automation is only as good as its logic. We must ensure that our automated system accounts for incomplete or ambiguous data, as a continuous flow of non-useful data adds complication and latency to the system. While the Geocoding API is as forgiving as possible for incomplete data, adding a check before feeding the system can go a long way.
This is especially vital when the data is derived from user inputs. Issues with data entry or misspellings are substantially more common and cleaning the data before use is a great way to avoid issues.
Once a system has been tested and is running, we’ll have a reasonable understanding of the health of our data. As such, we’ll likely know that the geocoding result needed is the top response. Using the limit parameter on the TomTom Geocoding API allows us to remove superfluous responses, helping to reduce overall latency in the system.
Similarly, we can use other parameters, like countrySet or radius, to reduce our search area. This allows TomTom to focus on particular areas and not waste time searching all over the world. The more streamlined we can make our geocode search, the quicker and more reliable our results will be.
We can use reverse geocoding to gain additional information about a set of coordinates. Reverse geocoding entails feeding a location’s coordinates into our TomTom reverse geocoding endpoint. Then, the system returns a human-readable location address. Reverse geocoding uses a location dataset and a reverse geocoding algorithm.
Using reverse geocoding can be instrumental in helping us verify the coordinates of a response, enabling us to cross-check locations and POIs. Additionally, it helps us avoid focusing on the wrong area of a map if the dataset doesn’t cover our POI, if we incorrectly feed the location data into it, or if we’ve incorrectly set our biases. This helps to verify the coordinates we are searching for.
TomTom’s Geocoding API enables us to effortlessly integrate geocoding into our applications, making determining ETAs and performing real-time tracking easier. It does this with the help of traffic data obtained from various addresses. But using geocoding can be challenging to implement — especially when we’re missing crucial information or if we have to overcome a suboptimal amount of human error.
Fortunately, we can use TomTom’s Geocoding API and the best practices outlined above to geocode effectively. TomTom’s geocoding service is beneficial when the full Search capabilities may oversaturate us with information. Fleet management is a complicated and dynamic task, but with the tools provided by TomTom — including geocoding — it’s a lot easier.
To implement the best practices outlined in this article and start including geocoding in your mapping application. Register for a TomTom Developer account and check out the TomTom Geocoding API.