none
Inconsistent Results from Bing Maps Geocoder RRS feed

  • Question

  • I wrote an application that parses a CSV file, extracts addresses and geocodes them using the Bing Maps REST API.  The problem I am having is that if I run the same file multiple times, I get different results.  On the first trial, rows 2 and 6 might return no matches.  On the following trial, rows 2 and 6 will return matches and row 4 might not.  I inspected the HTTP traffic using Fiddler.  My requests are properly formed, every response returns HTTP status code 200 and valid JSON, just some addresses yield results and some don't and the success or failure of a particular address changes from trial to trial.  Can anyone provide any insight?

    Sample Request:

    GET http://dev.virtualearth.net/REST/v1/Locations?o=json&adminDistrict=MI&locality=Shelby&postalCode=49455-1299&addressLine=72+South+State+Street&key={MyApiKey} HTTP/1.1
    Host: dev.virtualearth.net

    Sample Response:

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Transfer-Encoding: chunked
    Content-Type: application/json
    Server: Microsoft-IIS/8.0
    X-BM-TraceID: 9b6cfaa0abdb47b7b7e2790900bcddce
    X-BM-Srv: BL2M001304, BL2MSNVM001275, BL2MSNVM001299
    X-MS-BM-WS-INFO: 0
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Date: Fri, 22 Feb 2013 15:14:30 GMT

    247
    {"authenticationResultCode":"ValidCredentials", "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2013 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.", "resourceSets":[{ "estimatedTotal":0, "resources":[]}], "statusCode":200,"statusDescription":"OK", "traceId":"9b6cfaa0abdb47b7b7e2790900bcddce|BL2M001304|02.00.83.1900|BL2MSNVM001275, BL2MSNVM001299"}
    0

    ---

    Original Post on StackOverflow: http://stackoverflow.com/questions/15012502/inconsistent-results-from-bing-maps-geocoder/15013019#15013019



    Friday, February 22, 2013 4:05 PM

Answers

  • Since you are an Enterprise customer, please reach out to the Bing Maps Enterprise support team. They will be able to dig into this for you and escalate as needed. If you don't have their email it is available in the Bing Maps portal and is listed in the left side panel.

    http://rbrundritt.wordpress.com

    Friday, February 22, 2013 6:37 PM

All replies

  • If you are using a basic key and making several requests in a short period of time it is possible that your responses are being rate limited. When this happens no results are returned and a 200 message occurs, but the header value X-MS-BM-WS-INFO will be set to 1 to flag that the request has been rate limited. This is documented here: http://msdn.microsoft.com/en-us/library/ff701703.aspx

    Also, your address line has + for spaces. These should be %20. I suspect you are escaping rather than encoding your query.


    http://rbrundritt.wordpress.com

    Friday, February 22, 2013 4:47 PM
  • Hi Richard,

    Thanks for your response.  I'm using an enterprise API key and the X-MS-BM-WS-INFO is always 0, even in the case where results are expected but missing.  I don't think this is a rate limit issue.  I ran my app against a 1000 row CSV earlier this morning several times consecutively with no issues.  Now, I get a handful of failures with that same file.

    I'm using HttpUtility.UrlEncode() to encode the request URL.  That's where the +'s are coming from.  It seems to be working fine.  Since I don't have anything else to try at the moment, I'll give replacing +'s with %20 a try.  Is there a method like UrlEncode() to do that or do I have to do it manually?

    Friday, February 22, 2013 4:59 PM
  • Since you are an Enterprise customer, please reach out to the Bing Maps Enterprise support team. They will be able to dig into this for you and escalate as needed. If you don't have their email it is available in the Bing Maps portal and is listed in the left side panel.

    http://rbrundritt.wordpress.com

    Friday, February 22, 2013 6:37 PM