Microsoft Developer Network > Forums Home > Windows Live Developer Forums Forums > Bing Maps: Map Control Development > Geocoding through Bing Maps works but WebService not returning results
Ask a questionAsk a question
 

AnswerGeocoding through Bing Maps works but WebService not returning results

  • Tuesday, October 27, 2009 9:37 PMChandra.Sekhar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    When I search for this address (example: 1 Finlayson Green, Level  15 , Unit 01, , Singapore) on Bings Maps or the Virtual Earth object through JavaScript, it finds the lat lon position rightaway. But when I try to do the same through the MapPoint webservice, I'm not getting any results.


    Has anyone had a similar problem? If so, can you please tell me how to fix the problem?

    Here is a code snippet from my project which gets the GeoCode for a given address:
     

             string token = GetToken();

                    GeocodeService.GeocodeRequest geocodeRequest = new GeocodeService.GeocodeRequest();

                    geocodeRequest.Credentials = new GeocodeService.Credentials();

                    geocodeRequest.Credentials.Token = token;

     

                    geocodeRequest.Query = strAddress; // "1 Finlayson Green, Level  15 , Unit 01, , Singapore "

     

     

                    // Set the options to only return high confidence results

                    GeocodeService.ConfidenceFilter[] filters = new GeocodeService.ConfidenceFilter[1];

                    filters[0] = new GeocodeService.ConfidenceFilter();

                    filters[0].MinimumConfidence = GeocodeService.Confidence.High;

     

                    GeocodeService.GeocodeOptions geocodeOptions = new GeocodeService.GeocodeOptions();

                    geocodeOptions.Filters = filters;

                    geocodeRequest.Options = geocodeOptions;

                    GeocodeService.GeocodeServiceClient geocodeService = new GeocodeService.GeocodeServiceClient();

                    GeocodeService.GeocodeResponse geocodeResponse = geocodeService.Geocode(geocodeRequest);

     

                    if (geocodeResponse.Results.Length > 0)

                    {

                        oRet.AddressLine = geocodeResponse.Results[0].Address.AddressLine;

                        oRet.AdminDistrict = geocodeResponse.Results[0].Address.AdminDistrict;

                        oRet.BestView = geocodeResponse.Results[0].BestView;

                        oRet.CountryRegion = geocodeResponse.Results[0].Address.CountryRegion;

                        oRet.DisplayName = geocodeResponse.Results[0].DisplayName;

                        oRet.District = geocodeResponse.Results[0].Address.District;

                        oRet.FormattedAddress = geocodeResponse.Results[0].Address.FormattedAddress;

                        oRet.Latitude = geocodeResponse.Results[0].Locations[0].Latitude;

                        oRet.Longitude = geocodeResponse.Results[0].Locations[0].Longitude;

                        oRet.NoExactMatch = false;

                    }

                    else

                    {

                        oRet.FormattedAddress = "No results were found for the address";

                    }

     

    Thanks in advance. 


    Chandra Sekhar

Answers

  • Tuesday, October 27, 2009 9:51 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I've seen this before. The issue is that you have your confidence filter set to High. If you look at the VEPlace object that gets returned for that address in the AJAX control the confidence level is medium. Changing your confidence level to Medium will allow that location to be returned by the Geocoding Service.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
  • Saturday, October 31, 2009 3:31 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Is it possible that a different version is sitting on the server? Are you seeing any errors in the error logs? If your seeing connection errors it's possible that some of the connections are being blocked by your proxy or firewall.

    Windows Live Developer MVP - http://rbrundritt.spaces.live.com

All Replies

  • Tuesday, October 27, 2009 9:51 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I've seen this before. The issue is that you have your confidence filter set to High. If you look at the VEPlace object that gets returned for that address in the AJAX control the confidence level is medium. Changing your confidence level to Medium will allow that location to be returned by the Geocoding Service.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
  • Wednesday, October 28, 2009 5:43 PMChandra.Sekhar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I even changed the confidence level to "Low". But no effect. It still wouldn't find the addresses. Thanks.
    Chandra Sekhar
  • Wednesday, October 28, 2009 5:48 PMChandra.Sekhar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    My bad. Its working with confidence level LOW. Thank you very much.
    Chandra Sekhar
  • Wednesday, October 28, 2009 8:35 PMChandra.Sekhar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm confused. The same code works fine from my local machine but wouldn't geocode from the Server. On the server, its able to geocode some addresses though.
    Chandra Sekhar
  • Saturday, October 31, 2009 3:31 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Is it possible that a different version is sitting on the server? Are you seeing any errors in the error logs? If your seeing connection errors it's possible that some of the connections are being blocked by your proxy or firewall.

    Windows Live Developer MVP - http://rbrundritt.spaces.live.com