none
Why bing locations api doesn't return anything with specific culture parameter?

    Question



  • I got strange results when started adding culture parameter to Location bing api (this is connected to some addresses only)

    Documentation lists supported cultures: docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes

    When I use most of the cultures I see results, for example DE: dev.virtualearth.net/REST/v1/Locations/DK/8200,%20%C3%85rhus%20N,%20Storcenter%20Nord?key=[key]&culture=de

    Results: found

    But when I add "da" I get no results at all: dev.virtualearth.net/REST/v1/Locations/DK/8200,%20%C3%85rhus%20N,%20Storcenter%20Nord?key=[key]&culture=da

    Results: empty document

    It's not the general case because for this address it works well: dev.virtualearth.net/REST/v1/Locations/DK/1100,%20Kongens%20Nytorv%2013?key=[key]&culture=da

    Results: found

    I suspect that may be there are no translations (still can't find any mentions for that in documentation) but it means that I need to make 2 queries to API - one with culture, and if nothing found fallback to en-US culture.

    Can someone help me to understand that?



    • Edited by ianrygel Thursday, December 27, 2018 3:05 PM
    Wednesday, December 26, 2018 12:51 PM

Answers

  • That would be much simpler if I have control over it but i am working on batch processing of input data that I can't manage before it's actually processed. The confidence as well as defined address can be considered only after using api.

    At the moment I see no other way out than making 2 requests to have at least some result.

    I thank you for your help, IoTGirl :)

    • Marked as answer by ianrygel Saturday, December 29, 2018 10:46 AM
    Saturday, December 29, 2018 10:45 AM

All replies

  • Hi Ian,

    The docs for this param are at https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/culture-parameter

    Not sure why the culture param would cause that issue unless maybe it is spelled differently in the new language versus the old.

    Sincerely IoTGirl

    Friday, December 28, 2018 4:51 AM
    Owner
  • Hi IoTGirl,

    I would understand that if it is required to pass params localized with respect to culture but it is not.

    As an example we can use any Slavic language where the names will be totally different:

    https://dev.virtualearth.net/REST/v1/Locations/DK/8200,%20%C3%85rhus%20N,%20Storcenter%20Nord?key=[key]&culture=ru

    adminDistrict "Центральная Ютландия"
    adminDistrict2 "Орхус"
    countryRegion "Дания"
    formattedAddress "8200, Дания"
    locality "Aarhus N"
    postalCode "8200"

    Still found. So I believe the language of the input doesn't depend on the required culture.



    Friday, December 28, 2018 8:39 AM
  • My best guess is that you have a very low confidence value returned in the first result.  When you change the culture parameter it is enough to lower the probability of no match.  Do you have an exact address or location that you are searching for?  Maybe you should be using a query based search rather than an address based search for this case?

    THe options are available here: https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/?toc=%2Fen-us%2Fbingmaps%2Frest-services%2Ftoc.json&bc=%2Fen-us%2FBingMaps%2Fbreadcrumb%2Ftoc.json

    The closest I can find to the "Address" you are using is "Aarhus N, 8200, Denmark".  Maybe changing the address to https://dev.virtualearth.net/REST/v1/Locations/DK/8200,%20Aarhus%20N,%20Storcenter%20Nord?key=[key] would make a difference?

    Friday, December 28, 2018 5:26 PM
    Owner
  • I did a bit more digging and searching for "StorCenter Nord, Denmark" got me this https://binged.it/2QVzQ4Z

    So you could use the more precise address of "Finlandsgade 17 8200 Aarhus" to get a higher confidence in your result set that would probably survive across cultural options..


    Friday, December 28, 2018 5:31 PM
    Owner
  • That would be much simpler if I have control over it but i am working on batch processing of input data that I can't manage before it's actually processed. The confidence as well as defined address can be considered only after using api.

    At the moment I see no other way out than making 2 requests to have at least some result.

    I thank you for your help, IoTGirl :)

    • Marked as answer by ianrygel Saturday, December 29, 2018 10:46 AM
    Saturday, December 29, 2018 10:45 AM
  • You can try the query call as well as the address call as I mentioned.  Using the "StorCenter Nord, Denmark". You calls are all "structured"  when you get low confidence or an empty result, try and unstructured query instead and you may get a higher confidence as the address you are given was poorly structured.

    Note: If you are collecting addresses, we do offer autosuggest which will help folks inputing addresses only provide validated values.

    Saturday, December 29, 2018 6:17 PM
    Owner