Bing search failing
-
Thursday, December 08, 2011 6:12 PM
one of the things I regression test my windows phone app with is a bing search with the structured query having Keyword=pizza, latitude=3178971406, longitude=-111.13533601. today I ran that regression again and it produced no results. It used to always produce the same 10 results. (the pizza places are still there). When I specify a City and state instead of the geocoordinates it still works just fine.
What might have changed? Also, does Bing have a web pressence where I can test out these searches via a browser?
Thanks, Dean
.net Developer- Moved by Richard_BrundrittMicrosoft Employee, Owner Saturday, March 10, 2012 12:26 PM (From:Bing Maps: Map Control and Web services Development)
All Replies
-
Saturday, December 10, 2011 8:48 AMOwnerYou are missing a decimal place in your latitude parameter.
http://rbrundritt.wordpress.com -
Saturday, December 10, 2011 5:57 PM
Richard,
I mistyped in my post. The actual location, via my geowatcher, is 31.78971406, -111.03533601 (my house in Green Valley, AZ). So I forced a different location: 47.62, -111.03 (Bellevue, WA) and I found Pizza places there.
Hmmmm... So then I reduced that accuracy of my Green Valley location to 31.78, -111.03 and I get all the pizza places in Green Valley AZ!!
After a bunch of testing I find that the Bing Search will work with 6 digits of accuracy after the decimal point but not with 7. This is repeatable.
So, my regression testing appears to show that the behavior of the Bing Search service has changed; that it will not accept high accuracy Locations any longer. I can no longer just dump the GeoWatcher Location data into the Bing Search. I think this is a "breaking change" and a very bad thing.
Dean
.net Developer -
Sunday, December 11, 2011 6:12 PMOwner
I believe this was changed a while ago as a performance enhancement. 6 decimal places is equal to a third of a pixel at the closest zoom level in Bing Maps. Any more decimal places don't do anything. The search service would be reading in each character at ta time to determine if query is an address or a coordinate. If someone put in a really long number then this would take the search service longer to figure how to handle the query. Limiting coordinates to 6 decimal places is a best practice.
http://rbrundritt.wordpress.com- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Tuesday, January 10, 2012 7:00 PM
-
Sunday, December 11, 2011 8:30 PM
I would like to suggest that the Bing people talk to the WP7 people when they make a breaking change. If the GeoWatcher was changed to dish out just 6 digits before the Bing change then people like me wouldn't have their app broken. Everyone is going to have to add code to truncate the location.
A better solution would be for the Bing service to do the truncation making the whole thing transparent. I figure you have a whole bunch of WP7 navigation type apps broken. Why don't you ask them to do that now? Sounds like a trivial change.
IMHO a long way from a best practice.
thanks for responding.
Dean
.net Developer -
Thursday, March 29, 2012 12:41 AM
Richard,
I know this is off topic in this thread but...
I'm trying to find out what is going on regarding Bing Maps for Android. I went to the In-knowledge forum and it is DOA. I want to port some of my WP7 apps to android and I want to use Bing Maps if possible.
Can you point me in the right direction?
Thanks,
Dean
.net Developer
-
Tuesday, June 12, 2012 5:47 PM
I just stumbled upon this post while randomly browsing the web. This explains why my WP7 apps had problems with Bing REST services, although this wasn't apparent in all markets.
A pro tip I developed to solve this problem, and make your app global, is to simply create an instance of US culture (en-US) and then call ToString with the culture parameter on your latitude and longitude. Bing REST services only work with US culture number and date formats.

