none
Maps API returning trash coordinates RRS feed

  • Question

  • Hello,

    we rely on the Bing Maps API to do geo look-ups. Sadly, Bing often returns trash coordinates for many different requests. The result always points to:

    lat: 51.202465057373
    lon: 10.3822031021118

    (confidence medium)

    E. g. when I query Bing for 'Hagen, Nordrhein-Westfalen, Deutschland' (countryRegion=DE, locality=Hagen) it returns the above coordinates. (traceId: 521cdc7eea6b4f1a9ec16c08c8fedc76|DB40051734|7.7.0.0| it it helps). The web frontend does find Hagen, though.
    Same result for 'Berlin, Berlin, Deutschland' and pretty much any request without an address line, I think.

    I currently circumvent this by checking if the lat/lon returned is close to the above values and then querying another service. But that's ugly and wasting requests and time.

    I'm using the unstructured REST API: http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=xyz&addressLine=xyz&includeNeighborhood=1&maxResults=1&key=xyz

    IMHO the API shouldn't return trash coordinates but either just find the location (am I doing something wrong?) or not return anything (error out). But returning trashy coordinates with medium confidence is just wrong (unless I'm doing something weirdly wrong).

    Wednesday, July 12, 2017 2:48 PM

Answers

  • Using this query:

    http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=xyz&addressLine=xyz&includeNeighborhood=1&maxResults=1&key=xyz

    I am getting a valid response for Germany (51.202465057373, 10.3822031021118 is the center point).  This is of medium confidence due to the system going uphierarchy since it can't find your locality\address line.

    For:

    http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=Hagen&includeNeighborhood=1&maxResults=1&key=xyz

    I get correct results of formattedAddress=Hagen, NW, Germany (51.359920501709, 7.47126007080078) with high confidence.  If you are seeing different please let me know.



    • Edited by Justin_T Wednesday, July 12, 2017 3:08 PM
    • Marked as answer by BerliTec Wednesday, July 12, 2017 3:17 PM
    Wednesday, July 12, 2017 3:00 PM

All replies

  • Using this query:

    http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=xyz&addressLine=xyz&includeNeighborhood=1&maxResults=1&key=xyz

    I am getting a valid response for Germany (51.202465057373, 10.3822031021118 is the center point).  This is of medium confidence due to the system going uphierarchy since it can't find your locality\address line.

    For:

    http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=Hagen&includeNeighborhood=1&maxResults=1&key=xyz

    I get correct results of formattedAddress=Hagen, NW, Germany (51.359920501709, 7.47126007080078) with high confidence.  If you are seeing different please let me know.



    • Edited by Justin_T Wednesday, July 12, 2017 3:08 PM
    • Marked as answer by BerliTec Wednesday, July 12, 2017 3:17 PM
    Wednesday, July 12, 2017 3:00 PM
  • Alright, I double checked the URL my application's actually calling. The issue is that it adds the state and the country to the addressLine. Even with just the city name and the state it defaults to the above trash coordinates:

    http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=Hagen Nordrhein-Westfalen&addressLine=&includeNeighborhood=1&maxResults=1&key=

    Guess the state should go in adminDistrict, right?

    Thanks, you pointed me in the right direction.


    • Edited by BerliTec Wednesday, July 12, 2017 3:17 PM solved
    Wednesday, July 12, 2017 3:09 PM
  • If you are using the structure format (per your example), then yes you must have the right values in the correct parameters.

    The system will try to find matches based on your input. If it can't find a match for a given parameter but it can for other parameters it will return you a medium confidence result that states a match code of Uphierarchy.  The resulting value is the best match based on the query you submitted, and are considered valid coordinates.

    Properly formatted request would be:

    http://dev.virtualearth.net/REST/v1/Locations?countryRegion=DE&locality=Hagen&admindistrict=Nordrhein-Westfalen&addressLine=&includeNeighborhood=1&maxResults=1&key=xyz

    You could also use the unstructured query of:

    http://dev.virtualearth.net/REST/v1/Locations?q=Hagen,%20Nordrhein-Westfalen,%20Germany&maxresults=1&key=xyz


    • Proposed as answer by Justin_T Wednesday, July 12, 2017 3:20 PM
    • Unproposed as answer by Justin_T Wednesday, July 12, 2017 3:21 PM
    • Edited by Justin_T Wednesday, July 12, 2017 3:22 PM
    Wednesday, July 12, 2017 3:20 PM