GeoCode Excel Data with Bing Maps

If you haven’t read about Bing rules on doing this, please do.
Since we have done this in Google Maps, I thought it would be worthwhile to see how it’s done in Bing Maps.  This all uses cDataSet to abstract data and make all this a trivial exercise.

Quick start

  1. Download the  Google Maps workbook (button above)
  2. Amend Columns A,B,C in the VenueMaster workbook to your data
  3. Hit one of the buttons on that page to geocode (with Google, Bing, yahoo , create a KML file or plot the addresses on a map using Google, Yahoo, Bing or OVI.
  4. Read how it works below.  You will normally not need to do any coding – just possible tweak a parameter sheet. For example here is all that is needed to Plot addresses on a google map or a Bing Map, where the argument is the name of a parameter sheet.

Bing maps – vs – Google Maps

These restful apis work in pretty much the same way, Here are the main differences.
  •  Microsoft require you to get a Key to use Bing. In this downloadable example, I am using my key. If you use this code for anything, please get your own and follow the Microsoft rules on usage. Google do not require you to get a key, but limit your usage to a small number of queries daily.
  • Bing is less able to deal with amibuity. In the set of 10 random addresses, Bing was unable to identify  half of them. Google got them all.
  • There is a whole bunch of unnecessary stuff about copyright, and other junk that is returned from each query to Bing. What a waste of space and traffic.
  • Bing provides less detail than Google, but the results are a lot easier to deal with.
  • Bing is fussy about input – for example I needed to clean the input addresses to get rid of non printable characters and so on. Google doesn’t care about that.
  • Bing Maps has a stupid name.

The implementation

Essentially this is exactly the same kind of implementation as for the Google Version, so please take a look at that first and we can concentrate on the differences.

The parameter sheet

The jSon response from Bing is a different structure. However it can easily be accommodated in the same structure as we used for the Google version. Here it is with a couple of extra columns specific to Bing.
Note that the response from Bing is simpler, so we use simply the ‘fullkey’ to identify the field within that response.

The Bing Key

As mentioned you need a developer key to use Bing. In the downloadable example I am using my key. You need to get your own by registering at the Bing Portal. Once you have it you can enter it in the parameter sheet, replacing the one that is in the parameter sheet.

The Response

An example call is generated as below
and this the response
This response gets decoded into a cJobject and this data is used in populating the sheet.

The code

This is very similar to the Google Maps version, and calls many of the same modules which I won’t bother repeating here.  We are doing the same thing – namely geoMapping and filling in named fields such as country etc as specified, and according to the rules in a parameter sheet.

Summary

This Bing implementation was simply to contrast with the Google version. Although a little harder, I will stick to Google for Mapping. For questions and comments please use our forum. You can Download the example – googleMapping.xlsm
For help and more information join our forum, follow the blog, follow me on Twitter