Google Spreadsheets can import csv-data by =ImportData()formula. So why don't we make it fetch coordinates of the address in the next cell.

The order of the parameters is not convenient for us, so we change it. The query-parameter 'q' shall be the last one. We type in the first cell of Spreadsheets:

http://maps.google.com/maps/geo?output=csv&q=

In the next cell we type the requested address like Helsinki.

The third cell will add together the two previous cells and ask for data by ImportData() formula:

=ImportData(CONCATENATE(A2,B2))

When you finished typing that, you will see a miracle in the next cells: '200' (http status), '4' (Google accuracy parameter), 60.169879 (latitude of Helsinki) and 24.938408(longitude of Helsinki). Did we ask anything more?

And they say that there is no geocoding in Google Spreadsheets. Plus think how it can import and export. Hold my hat!

There is also automatic googling to get input data.

=GoogleLookup(entity,attribute)

can fetch your POI (entity) address(attribute), and you geocode that as above.

You can use the output via a variety of feeds or read it by ajax-api as JSON. You can for instance preload your pages GClientGeocoder cache to know the POIs. Your visitors don't find the POI by geocoding unless you took care of it.

18 comments:

Love it. I've been looking for this for a while now. Working on a site where anyone can put a place into a Google form, and now that will pretty easily translate into a crowd-sourced collaborative map. Thanks!

How would I get this to work if I want to query a series of restaurants in a particular city? E.g. I want to generate a table of all the McDonald's in Sacramento where I show the phone number, address, among other pertinent information.

I grew up there. I remember when the geo location of Google's headquarters was a dirt field. My friends and I would catch frogs in the creeks right there. Now there are little to no frogs, but tons of Googles.

I grew up there. I remember when the geo location of Google's headquarters was a dirt field. My friends and I would catch frogs in the creeks right there. Now there are little to no frogs, but tons of Googles.

I grew up there. I remember when the geo location of Google's headquarters was a dirt field. My friends and I would catch frogs in the creeks right there. Now there are little to no frogs, but tons of Googles.

I grew up there. I remember when the geo location of Google's headquarters was a dirt field. My friends and I would catch frogs in the creeks right there. Now there are little to no frogs, but tons of Googles.