# Google Maps Questions

**URL:** <https://www.ruby-forum.com/t/google-maps-questions/66260>\
**Category:** Rails\
**Created:** [August 24, 2006, 1:03pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260 "2006-08-24T13:03:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 24, 2006, 1:03pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260/1 "2006-08-24T13:03:56Z")

</div>

Hi,

Ive used this link to create google maps in my rails app. I have a few  
questions.

This example uses a US Geocoder to find the latitude and Longtitude of  
an address.  
Is there 1 available for the UK from google or any other service thats  
free?

I takes a couple of seconds to get the latitude and longitude from the  
geocoder, is it better to hold the latitude and longtitude in the  
database?  
Does anyone know where i can find a UK website that will provide me with  
the latitude and longtitude of a UK address?

Ive looked around the internet and [streetmap.co.uk](http://streetmap.co.uk) gives you the  
latitude & Longtitude for a particular postcode, not the exact address.

Any suggestions would be gretfull.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 24, 2006, 1:47pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260/2 "2006-08-24T13:47:51Z")

</div>

There is no data on precise co-ordinates of individual addresses, but  
post codes are pretty accurate… average of 13 addresses per postcode  
as far as I can remember.

A good place to go for co-ordinates is here:

> **[SamKnows](https://www.samknows.com/toys/coords.php?output=xml&pc=se270nb,sw47ln,s118th,s101nu)**
>
> Internet performance monitoring

You can list the postcodes seperated by commas as I’ve shown, and it  
gives you a nice XML output of postcodes with their co-ordinates.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 24, 2006, 3:07pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260/3 "2006-08-24T15:07:56Z")

</div>

yes on the question to store the lat and long in the database. that way,  
geocode is executed once instead of everytime someone accesses the  
google map.

John B. wrote:

> Hi,
> 
> Ive used this link to create google maps in my rails app. I have a few  
> questions.
> 
> This example uses a US Geocoder to find the latitude and Longtitude of  
> an address.  
> Is there 1 available for the UK from google or any other service thats  
> free?
> 
> I takes a couple of seconds to get the latitude and longitude from the  
> geocoder, is it better to hold the latitude and longtitude in the  
> database?  
> Does anyone know where i can find a UK website that will provide me with  
> the latitude and longtitude of a UK address?
> 
> Ive looked around the internet and [streetmap.co.uk](http://streetmap.co.uk) gives you the  
> latitude & Longtitude for a particular postcode, not the exact address.
> 
> Any suggestions would be gretfull.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 24, 2006, 3:11pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260/4 "2006-08-24T15:11:46Z")

</div>

koloa wrote:

> yes on the question to store the lat and long in the database. that way,  
> geocode is executed once instead of everytime someone accesses the  
> google map.

I run a cron job to populate the database with geocode info every night,  
that way data can be added to the database without the potential lag of  
a geocode lookup. Any record that doesn’t have long/lat fields does a  
geocode api query .

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 24, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260/5 "2006-08-24T15:46:34Z")

</div>

Chris L. wrote:

> koloa wrote:
> 
> > yes on the question to store the lat and long in the database. that way,  
> > geocode is executed once instead of everytime someone accesses the  
> > google map.
> 
> I run a cron job to populate the database with geocode info every night,  
> that way data can be added to the database without the potential lag of  
> a geocode lookup. Any record that doesn’t have long/lat fields does a  
> geocode api query .

Both Yahoo and Google offer Geocoding. Give those a shot.

[http://developer.yahoo.com/maps/rest/V1/geocode.html](http://developer.yahoo.com/maps/rest/V1/geocode.html)  
[http://www.google.com/apis/maps/documentation/](http://www.google.com/apis/maps/documentation/)

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 24, 2006, 4:10pm UTC](https://www.ruby-forum.com/t/google-maps-questions/66260/6 "2006-08-24T16:10:07Z")

</div>

John B. wrote:

> Is there 1 available for the UK from google or any other service thats  
> free?

There is a duscussion about UK codes here [http://drupal.org/node/19482](http://drupal.org/node/19482)

Try these links as well  
[http://gabriel.gironda.org/articles/2005/12/01/geolocation-in-ruby-on-rails](http://gabriel.gironda.org/articles/2005/12/01/geolocation-in-ruby-on-rails)  
[http://www.onrails.org/articles/2006/06/01/geoip-data](http://www.onrails.org/articles/2006/06/01/geoip-data)

If you have a decent budget, the data can be purchased  
[http://www.datadepot.co.uk/dept.asp?level=2&id=2250](http://www.datadepot.co.uk/dept.asp?level=2&id=2250)
