none
REST is not returning correct results............. RRS feed

  • Question

  • It is returning the following point for 145 King St., Charleston, SC:

                    LAT: 39.45000076293945

                    LON: -98.90799713134765

     

    When the actual coordinates are (approximately):

                    LAT: 32.777

                    LON: -79.933

     

    Which are not even close to each other.

     

    I verified this by going directly into a web browser and entering this URL:

    http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=US&adminDistrict=&locality=&postalCode=&addressLine=145 King St., Charleston, SC&output=json&jsonp=findcallback&key={a valid map key}

     


    Steve Kahler
    • Moved by Ricky_Brundritt Saturday, March 10, 2012 11:09 AM (From:Bing Maps: Map Control and Web services Development)
    Monday, September 26, 2011 6:27 PM

Answers

  • That's because you're trying to send all the parameters, comma-separated, in the addressLine parameter, while supplying null values for adminDistrict and locality.

    What you should be doing is separating them like this:

    http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=US&adminDistrict=SC&locality=Charleston&postalCode=&addressLine=145%20King%20St&output=json&jsonp=findcallback&key={bingmapskey}



    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Monday, September 26, 2011 8:19 PM
    Moderator

All replies

  • The LAT/LON REST is returning is out in the middle of the USA in Kansas.   I also found that no matter what address you enter even if you just enter a city and state it returns this same LAT/LON in the middle of the USA.
    Steve Kahler
    Monday, September 26, 2011 7:09 PM
  • That's because you're trying to send all the parameters, comma-separated, in the addressLine parameter, while supplying null values for adminDistrict and locality.

    What you should be doing is separating them like this:

    http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=US&adminDistrict=SC&locality=Charleston&postalCode=&addressLine=145%20King%20St&output=json&jsonp=findcallback&key={bingmapskey}



    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Monday, September 26, 2011 8:19 PM
    Moderator
  • It's worked thuis way with all of the parms in the addressline for the last 6 months.   This isn't new code in our web site it's been there for awhile since we started using BIng 7 with REST.

    Something must have changed with REST in the last few days.

    I guess we'll have to do some address parsing ourselves.

     

    I'm curious as to why it's returning a lat lon somehwre in Kansas ?   It used to return nothing when you entered something invalid.

     


    Steve Kahler
    Monday, September 26, 2011 8:23 PM