How use the parameter language for fr-FR into AZURE MAPS API

Bruno Martins-Lêdo 0 Reputation points
2024-05-23T09:38:32.86+00:00

Hi,

How I can force AZURE MAPS API to send me a result in french please ?

Example :

https://atlas.microsoft.com/geocode?api-version=2023-06-01&subscription-key=[[MYKEY]]&addressLine=0000%20BAIRRO%20PINHAO&countryRegion=BR&top=1&postalCode={[Null]&locality={[Null]

I want the result in french but he send me into spanish.

Other point, the countryRegion seems not working because the result send to Spain...

Regards,

Bruno

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
634 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 16,236 Reputation points Microsoft Employee
    2024-05-23T16:06:15.9133333+00:00

    Extracting the address from your query I get "0000 BAIRRO PINHAO, Brazil" when I ignore the nulls. Note that the nulls in the query string should be removed as they will be treated as part of the address and cause issues. Removing these and a result for Brazil is being returned. That said, the address in your query does not exist. I've tried several map platforms and none of them could find a decent result for this. Note, that for every version of this query I tested, the confidence property of the result was always low which is a good indicator that the input isn't well known and likely has an issue.

    To set the language to French in the v2 geocoder API you can pass "fr-FR" into the Accept-Language header of the request. That said, not all levels of addresses will be translated to any language you pass in. Country and maybe some states/city names may support most languages while street address level will generally only support the local languages of that address (e.g. the language that street signs would use in that area).

    The geocoder does not lock the results to a specific country, each parameter helps influence the results but would not limit the results to that. The v1 search APIs do have an option to lock the results to a specific country. The main reason for the difference is that the v2 geocoder is based on the Bing Maps geocoder and works the same way as Bing Maps does. This is to create a softer landing for those moving from Bing Maps to Azure Maps. There are some good best practices documented here: https://learn.microsoft.com/en-us/bingmaps/getting-started/bing-maps-api-best-practices The main one, is that passing your full address string as a single string into the query parameter generally provides better results based on testing.

    0 comments No comments