Aleksi Sitomaniemi
Aleksi Sitomaniemi

Reputation: 166

Here geocode API fails on addresses that have multiple umlaut characters

I've using the HERE geocode api through AWS Lambda for Finnish street addresses. I'm able to get solid results on most of the cases, but it appears as if the geocoding only works when there is no more than 1 (one) umlaut character in the query.

I invoke the lambda with aws cli like here:

aws lambda invoke --function-name arn:aws:lambda:eu-central-1:xxxxxxxxxxxx:function:serverlessrepo-Geocode-GeocodeFunction-XXXXXXXXXXXX out --payload '{"pathParameters": {"resourcePath": "v1/geocode"},"queryStringParameters": {"q": "Pääskystie 15, Oulu"}}'

For example the following queries return reasonable coordinates back:

'Pyhäjoki' 
'Töllintie 1, Oulu'

But if I query addresses that have multiple umlaut characters, I get an empty result set. Examples:

'Pyhäntä'
'Pääskystie 15, Oulu'

If the ä/ö characters are replaced with a/o, I also get a result, but as removing the diacritics from the query will potentially result in invalid match, it does not seem to be the right solution.

Am I missing a query parameter from the lambda payload, or is there something else amiss?

Upvotes: 2

Views: 87

Answers (1)

user3505695
user3505695

Reputation:

We tried to replicate with multiple umlaut characters. The result seems fine https://geocode.search.hereapi.com/v1/geocode?apiKey=xxxxx&q=Pyhäntä Pääskystie 15, Oulu&language=en-US&additionaldata=&maxresults=20&gen=8

{
"items": [
    {
        "title": "Pääskystie 15, FI-90650 Oulu, Suomi",
        "id": "here:af:streetsection:SSRElmH2PSCjTleaHm4wJB:CgcIBCCx07x9EAEaAjE1KGQ",
        "resultType": "houseNumber",
        "houseNumberType": "PA",
        "address": {
            "label": "Pääskystie 15, FI-90650 Oulu, Suomi",
            "countryCode": "FIN",
            "countryName": "Suomi",
            "state": "Pohjois-Suomi",
            "county": "Pohjois-Pohjanmaa",
            "city": "Oulu",
            "district": "Oulu",
            "street": "Pääskystie",
            "postalCode": "FI-90650",
            "houseNumber": "15"
        },
        "position": {
            "lat": 65.01821,
            "lng": 25.53896
        },
        "access": [
            {
                "lat": 65.01785,
                "lng": 25.53824
            }
        ],
        "mapView": {
            "west": 25.53683,
            "south": 65.01731,
            "east": 25.54109,
            "north": 65.01911
        },
        "scoring": {
            "queryScore": 0.67,
            "fieldScore": {
                "city": 1.0,
                "streets": [
                    1.0
                ],
                "houseNumber": 1.0
            }
        }
    }
]

}

Can you try once more and revert if there is difference with what you are trying.

Upvotes: 1

Related Questions