Hands On

Improve Your Address Data with HERE Geocoding: Part 1

By Sayna Parsi | 01 July 2020

Try HERE Maps

Create a free API key to build location-aware apps and services.

Get Started

[Writer’s note: This is a blog series that’s all about modern data management. You’ll learn how to improve existing ambiguous or incomplete location data as well as new data you collect.]

From collecting and understanding customer insights to developing a successful product strategy, data is a core pillar of a successful business. When it comes to data, the not-so-old adage applies: “garbage-in, garbage-out”.  After all, your decisions can only be as good as your data, so it is vital to ensure your data is high quality. It’s not always that you can improve your data quality without a compromise, but location data is a lucky exception.

“You may only get one chance to make a first impression,” but you get two shots at improving your location data. Humans are responsible for inputting incomplete, or ambiguous location data, and sometimes humans make mistakes. So the first step to improving your data is to provide autosuggest (aka autocomplete) to help your users with choosing a valid address. With autosuggest, your users will also benefit from not having to type the entire address. Even after you have collected your data, you can retroactively improve it and we’ll talk more about how you can do that later in this series. What won’t cover in these blogs are getting noisy GPS data and filtering bot-generated data.

 

Using Autosuggest to collect high-quality data

If you are on a journey to collect better data, Autosuggest is a great tool to get started. You have most likely experienced using some form of Autosuggest when searching for a place or an address and see predictions appear as you type. HERE Autosuggest API is a web service that allows you to bring this experience to your users. It works by taking a string with over an HTTP call and it returns place suggestions in response to that request. Even if you have a custom form with separate input areas for state, zip code, and city and still use Autocomplete to help your user fill the form faster by automatically populating the form after your user chooses a suggested address.

You can tailor the suggestions to return predictions that are closer to your user and you can even customize the language that the results appear in. Let’s look at a specific example. I chose Seattle as my central location here, so the results have a bias towards places in Seattle. The live demo for Autosuggest is also available on jsFiddle

 

This is what a call to Autosuggest API looks like:


https://autosuggest.search.hereapi.com/v1/autosuggest?at=38.71014896078624,-98.60787954719035&limit=5&q=Pike&apiKey=YOUR_API_KEY

Here's the API response. You can see that it returns the suggestions along with the highlight information, that allows you to display the character match of the query and the prediction by adding custom styles such as underlining, or highlighting the string match.


{
    "items": [
        {
            "title": "E Pike Dr, Sylvan Grove, KS 67481, United States",
            "id": "here:af:street:n02pLKALuDwKAsduJ7nMPB",
            "resultType": "street",
            "address": {
                "label": "E Pike Dr, Sylvan Grove, KS 67481, United States",
                "countryCode": "USA",
                "countryName": "United States",
                "state": "Kansas",
                "county": "Lincoln",
                "city": "Sylvan Grove",
                "street": "E Pike Dr",
                "postalCode": "67481"
            },
            "position": {
                "lat": 39.08835,
                "lng": -98.38702
            },
            "distance": 46193,
            "mapView": {
                "west": -98.48442,
                "south": 39.08824,
                "east": -98.28957,
                "north": 39.09129
            },
            "highlights": {
                "title": [
                    {
                        "start": 2,
                        "end": 6
                    }
                ],
                "address": {
                    "label": [
                        {
                            "start": 2,
                            "end": 6
                        }
                    ],
                    "street": [
                        {
                            "start": 2,
                            "end": 6
                        }
                    ]
                }
            }
        },
        ...additional results ...
}

Now let’s try setting the language to German for fun, here's our API call:


https://autosuggest.search.hereapi.com/v1/autosuggest?at=38.71014896078624,-98.60787954719035&limit=3&q=Pike&lang=de&apiKey=YOUR_API_KEY

And the results are:


{
    "items": [
        {
            "title": "Pike Place Markt",
            "id": "here:pds:place:840c23nb-80862ee36c5c4df3b946a71a6606e447",
            "resultType": "place",
            "address": {
                "label": "Pike Place Markt, 85 Pike St, Seattle, WA 98101-2024, Vereinigte Staaten",
                "countryCode": "USA",
                "countryName": "Vereinigte Staaten",
                "state": "Washington",
                "county": "King",
                "city": "Seattle",
                "district": "Pike Market",
                "street": "Pike St",
                "postalCode": "98101-2024",
                "houseNumber": "85"
            },
            "position": {
                "lat": 47.60832,
                "lng": -122.34081
            },
            "access": [
                {
                    "lat": 47.6087,
                    "lng": -122.34055
                }
            ],
            "distance": 5960,
            "categories": [
                {
                    "id": "300-3000-0023",
                    "name": "Touristenattraktion",
                    "primary": true
                },
                {
                    "id": "300-3000-0000",
                    "name": "Sehenswürdigkeit"
                },
                {
                    "id": "500-5000-0000",
                    "name": "Hotel oder Motel"
                },
                {
                    "id": "550-5510-0204",
                    "name": "Gartenanlage"
                },
                {
                    "id": "600-6300-0067",
                    "name": "Delikatessengeschäft"
                },
                {
                    "id": "600-6900-0000",
                    "name": "Konsumgüter"
                },
                {
                    "id": "600-6900-0096",
                    "name": "Fachgeschäft"
                },
                {
                    "id": "600-6900-0247",
                    "name": "Markt"
                },
                {
                    "id": "800-8200-0295",
                    "name": "Einrichtung für Bildung/Fortbildung"
                }
            ],
            "references": [
                {
                    "supplier": {
                        "id": "core"
                    },
                    "id": "1212101839"
                },
                {
                    "supplier": {
                        "id": "core"
                    },
                    "id": "17202733"
                },
                {
                    "supplier": {
                        "id": "core"
                    },
                    "id": "998713833"
                },
                {
                    "supplier": {
                        "id": "tripadvisor"
                    },
                    "id": "103584"
                },
                {
                    "supplier": {
                        "id": "tripadvisor"
                    },
                    "id": "16932579"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "44Hk9LbRS4WDgZ2fwivvpA"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "5bVJayfycRZYVOajtR2pQA"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "5pU9Ahv7ow4XRyhjeE754A"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "BJo5lD9IaZYKgoxGimmaSw"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "JsvxX0ja8GS5tJx13C8JBA"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "egwmnmyGZ7clzCkRS2uZTg"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "ktQ2J90Mk3aUvBb5P5a6wQ"
                },
                {
                    "supplier": {
                        "id": "yelp"
                    },
                    "id": "s-9BYsAd4fl06Yq9u_OO7Q"
                }
            ],
            "highlights": {
                "title": [
                    {
                        "start": 0,
                        "end": 4
                    }
                ],
                "address": {
                    "label": [
                        {
                            "start": 0,
                            "end": 4
                        }
                    ]
                }
            }
        },
        ...additional results ...

Let’s revisit the core lessons from this blog: we covered how to use Autosuggest to help customers input better data in order to improve the overall address quality in your system. And as a side benefit, your customers will be able to save some time by typing less. Next time, we’ll be covering standardizing location data so stay tuned!