Deprecated
Google has now stopped its Earth API and Maps API is a paid for API nowadays. Some capabilities have also been either removed or changed. Therefore, I had to remove all examples of VizMap applications I had created. I didn’t remove the entire topic as I thought some of the code may still be useful with some modifications. 

Geocode Excel Data with Yahoo Placemaker

If you haven’t read about Yahoo rules on doing this, please do.
Since we have done this in Google Maps, and in Bing Maps, I thought it would be worthwhile to see how it’s done in Yahoo Placemaker (Yahoo maps is deprecated and has been superseded by OVI maps .. which I guess I might try next) .

GeoCoding with Yahoo Placemaker – vs – Google Maps -vs- Bing Maps

I have already looked at geocoding with Bing Maps -vs- Google Maps and Google Maps is a clear winner. Yahoo Placemaker is pretty good at first glance even though it  claims not to be a geocoder.  Note that I am just using the basic REST URI query in all these examples – since the whole point to access directly from Excel. Comparing capabilities under Javascript would be a whole different ballgame.
  •  Yahoo require you to get a Key to use Placemaker which they call and Application ID. In this downloadable example, I am using my key. If you use this code for anything, please get your own and follow the Yahoo rules on usage. Google do not require you to get a key, but limit your usage to a small number of queries daily.
  • Yahoo was as good as or better than Google in dealing with ambiguity.
  • The Yahoo response is clean and does not contain a bunch of unnecessary waffle.
  • The Yahoo response is even simpler than the Bing one, and easier to deal with and decode. It is so similar to Bing that I was able to use the same modules to deal with both, so implementing Placeholder was about a 30 minute job, mainly to find out what the field names were.
  • Yahoo provides less detail than both Google and Bing, but most of what you would need is there. It does not provide a ‘cleaned up, full address’ field though, which the other 2 do. On the other hand, this can easily be constructed from other fields.
  • Its confusing that Yahoo Placeholder is not actually Yahoo Maps. Yahoo Maps is actually OVI maps, which I haven’t tried .. yet.

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 Yahoo is a different structure to Google, but similar to Bing. 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 Yahoo contrasted against the Bing Section of our parameter sheet. Note that Bing does not provide a country code like US, DE etc – seems like a big omission actually – Google (although complicated to find), and  Yahoo both do.

Note that the response from both Bing and Yahoo are simpler, so we can use the ‘fullkey’ parameter to identify the field within that response.

The Yahoo Placemaker Key

As mentioned you need a developer app ID to use Yahoo. In the downloadable example I am using my key. You need to get your own by registering at the Yahoo developer center. 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

http://where.yahooapis.com/geocode?location=1600%20Amphitheatre%20 Pkwy%2C%20Mountain%20View%2C%20CA%2094043%2C%20USA &flags=J&appid=xxxxxxxxxx

and this the response – a lot briefer and more to the point than Bing or Google.

{“ResultSet”:{“version”:”1.0″,”Error”:0,”ErrorMessage”:”No error”,”Locale”:”us_US”,”Quality”:87, “Found”:1,”Results”: [{“quality”:87, “latitude”:”37.423232″, “longitude”:”-122.085569″,”offsetlat”:”37.423109″, “offsetlon”:”-122.085598″, “radius”:500,”name”:””, “line1″:”1600 Amphitheatre Pky”, “line2″:”Mountain View, CA 94043-1351″,”line3″:””, “line4″:”United States”, “house”:”1600″,”street”:”Amphitheatre Pky”,”xstreet”:””,”unittype”:””, “unit”:””, “postal”:”94043-1351″,”neighborhood”: “”, “city”:”Mountain View”, “county”:”Santa Clara County”,”state”: “California”, “country”:”United States”,”countrycode”:”US”,”statecode”:”CA”, “countycode”:””,”uzip”:”94043″, “hash”:”92F5774D0FC9C1AA”, “woeid”:12797130,”woetype”:11}]}}

This response gets decoded into a cJobject and this data is used in populating the sheet.

The code

This is very similar to Complete Excel Address Data with Bing Maps API, and calls many of the same modules which I won’t bother repeating here. We are doing the same thing – namely geoCoding and filling in named fields such as country etc as specified, and according to the rules in a parameter sheet. This is the yahooMappingExample module in the downloadable GoogleMapping.xlsm file.

In fact since this was so close to the Complete Excel Address Data with Bing Maps API example, I generalized a few more procedures that could be used by both. These can be found in the Publics module in the downloadable GoogleMapping.xlsm file.

Summary

Complete Excel Address Data with Yahoo Placemaker Maps API was a breeze to implement, partly because the work had already been done with Complete Excel Address Data with Bing Maps API and Complete Excel Address Data with Google Mapping API. Nevertheless, the simple jSon response to the REST query was refreshingly clutter free, with only a couple of minor things missing. Although I am focusing on Google Maps API for the projects in this section, I may return to this at a later date. I look forward to your questions and comments at our forum.