[BNM] Geo data

1 view
Skip to first unread message

Wayne Douglas

unread,
Jan 27, 2009, 6:29:48 AM1/27/09
to Brighton New Media
Hi
Anyone know of the best way to deal with geo data & postcodes?

I don't have concrete details yet but it will probably be standard stuff
like turning co-ords into postcodes and back again and what not.

Preferably free of course otherwise - cheap like the budgy.

w://
--

BNM Subscribe/Unsubscribe:
http://www.brightonnewmedia.org/options/bnmlist

BNM powered by Wessex Networks:
http://www.wessexnetworks.com

David Pashley

unread,
Jan 27, 2009, 6:35:24 AM1/27/09
to Brighton New Media
On Jan 27, 2009 at 11:29, Wayne Douglas praised the llamas by saying:

> Hi
> Anyone know of the best way to deal with geo data & postcodes?
>
> I don't have concrete details yet but it will probably be standard stuff
> like turning co-ords into postcodes and back again and what not.
>
> Preferably free of course otherwise - cheap like the budgy.

Massively incomplete list available at Free The Postcode.

http://www.freethepostcode.org/

If you don't need huge accuracy, the first number after the space will
get you within a kilometer.

--
David Pashley
da...@davidpashley.com
Nihil curo de ista tua stulta superstitione.

Alastair James

unread,
Jan 27, 2009, 6:44:07 AM1/27/09
to Brighton New Media
Hi...
Really depends on what level of detail your need and what you want to do
with them.

If you need access to the lat / lng values (not just displaying them on a
map):
------------

The UK postcode database is owned by royal mail (boo hiss) who charge alot
of the data you need to map full UK postcodes to lat,lng points.

However, the first 4/5 digits (E.g. BN13 5, BN1 3 etc...) ARE free
available. Depending on the postcode density at that point, these should
return points within a hundred meters or so.

Best bet is to use the HTTP google maps geocoding webservice API:
http://code.google.com/apis/maps/documentation/geocoding/index.html

If you only need to display on a map:
-------------

A more accurate way (since google have an agreement with royal mail, and you
dont get the actual values) is to use the javascript google maps geocoding
API.

http://code.google.com/apis/maps/documentation/services.html#Geocoding

Cheers

al

2009/1/27 Wayne Douglas <wa...@codingvista.com>

--
Dr Alastair James
CTO James Publishing Ltd.

www.worldreviewer.com
Winner Yahoo! Finds of the Year
WINNER Travolution Awards Best New Online Travel Company 2008
"In a market increasingly crowded with new content and experience-led sites,
Worldreviewer stands out a mile. It has used exclusive editorial and
excellent tools to wonderful effect and ensured its commercial partnerships
are relevant to the target market."

Blogs: onewheeledbicycle.com, traveltelegraph.com

"Utinam logica falsa tuam philosophiam totam suffodiant!"

Alastair James

unread,
Jan 27, 2009, 6:45:36 AM1/27/09
to Brighton New Media
I should also add that I have seen a CSV file of the (freely available)
short postcode (BN1, BN2 etc...) to lat,lng mapping available online...
Try googling for "UK postcodes geocode csv" or something!

Al

2009/1/27 Alastair James <al.j...@gmail.com>

Alastair James

unread,
Jan 27, 2009, 6:55:44 AM1/27/09
to Brighton New Media
Finally, I have also used this API before:
http://emad.fano.us/blog/?p=277

al

2009/1/27 Alastair James <al.j...@gmail.com>

Wayne Douglas

unread,
Jan 27, 2009, 7:03:28 AM1/27/09
to Brighton New Media
Cheers guys - some really helpful pointers there.
I was just messing about with this:

http://code.google.com/apis/maps/documentation/examples/geocoding-simple.html

seems to be out. It seems to be pointing well north of any I know of the top
of my head.

Strange

w://

2009/1/27 Alastair James <al.j...@gmail.com>

Tom Coady

unread,
Jan 27, 2009, 7:05:18 AM1/27/09
to Brighton New Media
On Tue, Jan 27, 2009 at 11:44 AM, Alastair James <al.j...@gmail.com> wrote:

> The UK postcode database is owned by royal mail (boo hiss) who charge alot
> of the data you need to map full UK postcodes to lat,lng points.


Ordnance Survey surely? No doubt "consulting" some Lord about full
privatisation as I type.
http://www.ordnancesurvey.co.uk/oswebsite/products/codepoint/pdf/pricelist_C-P.pdf
Their licensing would make Bill G proud.

Michael Rose

unread,
Jan 27, 2009, 7:09:35 AM1/27/09
to Brighton New Media

Produced by civil servants = Crown copyright = Hang on... Haven't I paid
for that once already?

BNM Subscribe/Unsubscribe:
http://www.brightonnewmedia.org/options/bnmlist

############################################################
Please consider the environment before printing this e-mail.

This e-mail message, including any attachments, is for the sole use of the person to whom it has been sent and may contain information that is confidential or legally protected. If you are not the intended recipient or have received this message in error, you are not authorized to copy, distribute, or otherwise use this message or its attachments. Please notify the sender immediately by return e-mail, and permanently delete this message and any attachments. Study Group makes no warranty that this e-mail is error or virus free. Study Group International Ltd, Registered in England, number 3108030, Registered office: 1 Billinton Way, Brighton, East Sussex BN1 4LF. Study Group International Ltd is the parent company of Bellerbys Educational Services and Embassy CES.
############################################################

Aegir Hallmundur

unread,
Jan 27, 2009, 7:13:57 AM1/27/09
to Brighton New Media
2009/1/27 Michael Rose <MR...@studygroup.com>

>
> Produced by civil servants = Crown copyright = Hang on... Haven't I paid
> for that once already?
>

> Yeah, sickening isn't it? It belongs to the Crown, not us. Government
organisations get to use it 'free', but if they want to create anything with
it and make it available to thee and me, it's no go.

It's something the US definitely does better than us - all publicly funded
works there are public domain.

--
Aegir Hallmundur
http://aegir.me/
http://ministryoftype.co.uk/
http://paperpixel.co.uk/

Michael Rose

unread,
Jan 27, 2009, 7:16:08 AM1/27/09
to Brighton New Media

You can use maps from 1959 though - woo!

-----Original Message-----
From: bnmlist...@brightonnewmedia.org
[mailto:bnmlist...@brightonnewmedia.org] On Behalf Of Aegir
Hallmundur
Sent: 27 January 2009 12:14
To: Brighton New Media
Subject: Re: [BNM] Geo data

2009/1/27 Michael Rose <MR...@studygroup.com>

BNM Subscribe/Unsubscribe:
http://www.brightonnewmedia.org/options/bnmlist

############################################################
Please consider the environment before printing this e-mail.

This e-mail message, including any attachments, is for the sole use of the person to whom it has been sent and may contain information that is confidential or legally protected. If you are not the intended recipient or have received this message in error, you are not authorized to copy, distribute, or otherwise use this message or its attachments. Please notify the sender immediately by return e-mail, and permanently delete this message and any attachments. Study Group makes no warranty that this e-mail is error or virus free. Study Group International Ltd, Registered in England, number 3108030, Registered office: 1 Billinton Way, Brighton, East Sussex BN1 4LF. Study Group International Ltd is the parent company of Bellerbys Educational Services and Embassy CES.
############################################################

Premasagar Rose

unread,
Jan 27, 2009, 7:31:09 AM1/27/09
to Brighton New Media
Wayne Douglas said (@ 27 January 2009 11:29:48):

> Anyone know of the best way to deal with geo data & postcodes?
>

Hi Wayne,
This is a slightly simplified version of a function I use in my
(soon-to-be-released) jQuery geo plugin. It utilises a hidden JSON Rest
API that is part of the Google Local Search service. (Is that naughty?):

function geocode(address, callback){
var url = 'http://www.google.com/uds/GlocalSearch?q=' + address +
'&v=1.0&callback=?';
$.getJSON(url, function(data){
var result, ll;
if (data && data.responseData && data.responseData.results &&
data.responseData.results[0]){
result = data.responseData.results[0];
ll = [result.lat, result.lng];
callback(ll, data);
}
else {
callback(false);
}
});
},


// Call it like so:
geocode("BN3 1EF", myCallbackFunc);

It'll return an accurate lat/lng of the postcode, *not* just for the
first part of the postcode, which is what you get if you use the
official Google Maps geocoder API.


Premasagar

--
Premasagar Rose, Dharmafly
http://dharmafly.com | p...@dharmafly.com | 07941 192398


Leo Brown

unread,
Jan 27, 2009, 7:32:44 AM1/27/09
to Brighton New Media
Sweet - that has to be the most concise.

But yes, if it's not published, it could disappear I suppose.

Be good to have a backup/cache...

Ta,
Leo

-----Original Message-----
From: bnmlist...@brightonnewmedia.org
[mailto:bnmlist...@brightonnewmedia.org] On Behalf Of Premasagar Rose
Sent: 27 January 2009 12:31
To: Brighton New Media
Subject: Re: [BNM] Geo data


Premasagar

--

Wayne Douglas

unread,
Jan 27, 2009, 7:33:38 AM1/27/09
to Brighton New Media
HAHA
I think that might be a bit naughty - but we like naughty!!

:D

w://

2009/1/27 Premasagar Rose <p...@dharmafly.com>

Nick Taylor

unread,
Jan 27, 2009, 7:37:37 AM1/27/09
to Brighton New Media

So have you had a bit of experience with the google reverse geocoder then?

I'm tinkering with it at the moment... and I'm sure (sure, I am) that
google used to give you a list of "options" if you typed in an ambiguous
name...

... and from the data.responseData.results[0], I kindof assume that
there must be a way of getting data.responseData.results[1]?

But it doesn't seem to do this. For example if I search for Birmingham,
it takes me to Birmingham Alabama, without giving any alternatives.

Do you know if there's a way of getting a list of alternatives?


Sorry - slight thread hijack etc.

Nick


--

______________________________________________________________________
NICK TAYLOR :: ni...@tangerineworks.com
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
www.genomicon.com :: The Crowd-Sourcing of Intelligent Design
www.ikostar.com :: Semi Self-Depracatory Alter-Egotism
www.twitter.com/ikostar :: Twitter
www.tangerineworks.com :: Web dev
www.free-the-web.com :: Boycott IE6
www.11v11.com :: Football
www.weirdsky.com :: T-shirts for alpha geeks


(UK) +44 750 925 2870
(NZ) +64 273 740 101
Skype nicktaylor1181

Premasagar Rose

unread,
Jan 27, 2009, 7:38:12 AM1/27/09
to Brighton New Media
"But officer, I was just browsing through Firebug one day and sort of...
found it. And finders keepers, and all... Right?"

P

Wayne Douglas said (@ 27 January 2009 12:33:38):

Premasagar Rose

unread,
Jan 27, 2009, 7:49:44 AM1/27/09
to Brighton New Media
Nick Taylor said (@ 27 January 2009 12:37:37):

> I'm tinkering with it at the moment... and I'm sure (sure, I am) that
> google used to give you a list of "options" if you typed in an ambiguous
> name...
>

Hi Nick,
Yes, I think you're right. It did used to give a list and doesn't
seem to now. Strange.
You will get the right result if you put "Birmingham, UK", but it
looks like there's just one result at a time now.

Prem

David Pashley

unread,
Jan 27, 2009, 8:14:30 AM1/27/09
to Brighton New Media
On Jan 27, 2009 at 12:05, Tom Coady praised the llamas by saying:

> On Tue, Jan 27, 2009 at 11:44 AM, Alastair James <al.j...@gmail.com> wrote:
>
> > The UK postcode database is owned by royal mail (boo hiss) who charge alot
> > of the data you need to map full UK postcodes to lat,lng points.
>
>
> Ordnance Survey surely? No doubt "consulting" some Lord about full
> privatisation as I type.
> http://www.ordnancesurvey.co.uk/oswebsite/products/codepoint/pdf/pricelist_C-P.pdf
> Their licensing would make Bill G proud.

The PAF is owned by Royal Mail.

http://www.royalmail.com/portal/rm/jump2?mediaId=400085&catId=400084

--
David Pashley
da...@davidpashley.com
Nihil curo de ista tua stulta superstitione.

Wayne Douglas

unread,
Jan 27, 2009, 8:17:42 AM1/27/09
to Brighton New Media
figures.
can we sack the crown now please?

2009/1/27 David Pashley <da...@davidpashley.com>

Alastair James

unread,
Jan 27, 2009, 9:11:06 AM1/27/09
to Brighton New Media
@Prem:
Hi, is there any particular reason you are using a 'reverse engineered'
glocalsearch API call, as opposed to their public HTTP geocoding api (
http://code.google.com/apis/maps/documentation/geocoding/index.html)? Is it
more accruate or something?

Al

2009/1/27 Wayne Douglas <wa...@codingvista.com>

--

Dr Alastair James
CTO James Publishing Ltd.

www.worldreviewer.com
Winner Yahoo! Finds of the Year
WINNER Travolution Awards Best New Online Travel Company 2008
"In a market increasingly crowded with new content and experience-led sites,
Worldreviewer stands out a mile. It has used exclusive editorial and
excellent tools to wonderful effect and ensured its commercial partnerships
are relevant to the target market."

Blogs: onewheeledbicycle.com, traveltelegraph.com

"Utinam logica falsa tuam philosophiam totam suffodiant!"

Alastair James

unread,
Jan 27, 2009, 9:15:17 AM1/27/09
to Brighton New Media
@Wayne. You have probably done this already, but its as simple as:
http://maps.google.com/maps/geo?q=BN1+3FP&output=json&oe=utf8&sensor=false&gl=gb

Al

2009/1/27 Alastair James <al.j...@gmail.com>

> @Prem:

Premasagar Rose

unread,
Jan 27, 2009, 9:16:07 AM1/27/09
to Brighton New Media
Alastair James said (@ 27 January 2009 14:11:06):

> @Prem:
> Hi, is there any particular reason you are using a 'reverse engineered'
> glocalsearch API call, as opposed to their public HTTP geocoding api (
> http://code.google.com/apis/maps/documentation/geocoding/index.html)? Is it
> more accruate or something?
>
> Al
Yes, exactly that. The public version only gives you the lat/lng for the
centre of the postcode area. This is the first half of the postcode,
e.g. "BN3". But the hidden API gives you the location for the full postcode.

Premasagar Rose

unread,
Jan 27, 2009, 9:17:50 AM1/27/09
to Brighton New Media
Alastair James said (@ 27 January 2009 14:15:17):

> @Wayne. You have probably done this already, but its as simple as:
> http://maps.google.com/maps/geo?q=BN1+3FP&output=json&oe=utf8&sensor=false&gl=gb
>
> Al

Yes, notice that this gives the same response as:
http://maps.google.com/maps/geo?q=BN1+4NS&output=json&oe=utf8&sensor=false&gl=gb

Alastair James

unread,
Jan 27, 2009, 9:38:55 AM1/27/09
to Brighton New Media
>Yes, exactly that. The public version only gives you the lat/lng for the
centre of the postcode area. This is the first half of the postcode, e.g.
"BN3". But the hidden API gives you the location for the full postcode.
@Prem:

Ohhhhhhhhhhh... juicy... Thanks for the tip!

Al

2009/1/27 Premasagar Rose <p...@dharmafly.com>

James Moss

unread,
Jan 27, 2009, 10:30:49 AM1/27/09
to Brighton New Media
Theres been lots of suggestions already but just incase you dont feel
comfortable using a hidden Google API, the multimap API is very good
http://www.multimap.com/openapidocs/1.2/web_service/ws_geocoding.htm. Ive
got a feeling its tapping into Microsoft's data since they bought them out
last year.

We've used it to nice effect on the mishonmackay site:
http://www.mishonmackay.com/property-search/property-map/

James Moss | Developer
Solv.IT | 01273 25 20 24


2009/1/27 Alastair James <al.j...@gmail.com>

David Pashley

unread,
Jan 27, 2009, 11:04:14 AM1/27/09
to Brighton New Media
On Jan 27, 2009 at 13:17, Wayne Douglas praised the llamas by saying:
> 2009/1/27 David Pashley <da...@davidpashley.com>

> >
> > The PAF is owned by Royal Mail.
> >
> > http://www.royalmail.com/portal/rm/jump2?mediaId=400085&catId=400084
> >
> figures. can we sack the crown now please?
>
Given that the Royal Mail is a government owned company, does it not
have a duty to make money for its shareholders by monetisation its
assets, of which the PAF is a good example.

Wayne Douglas

unread,
Jan 27, 2009, 11:11:50 AM1/27/09
to Brighton New Media
If I believed that money went back into the country then I'd be more
inclined to back it - as it stands our taxes are used to fight dud wars,
bail out corrupt economic systems and line the pockets of fat cat MPs.
w://

2009/1/27 David Pashley <da...@davidpashley.com>

Huw Selley

unread,
Jan 27, 2009, 11:13:51 AM1/27/09
to Brighton New Media

On 27 Jan 2009, at 16:11, Wayne Douglas wrote:

> If I believed that money went back into the country then I'd be more
> inclined to back it - as it stands our taxes are used to fight dud
> wars,
> bail out corrupt economic systems and line the pockets of fat cat MPs.
> w://

In addition to providing financial support for the poor and dis-
advantaged, medical care for all and a myriad other good things.

Premasagar Rose

unread,
Jan 27, 2009, 11:16:43 AM1/27/09
to Brighton New Media
Leo Brown said (@ 27 January 2009 12:32:44):

> Sweet - that has to be the most concise.
>
> But yes, if it's not published, it could disappear I suppose.
>
> Be good to have a backup/cache...
>

I used this reverse-geocoding of a postcode with the hidden Google API
on <http://easthampshire.org/map>. The code allows for the possibility
of the API being unavailable in future. In that case, it falls back on
the less accurate, public API.

Prem

Wayne Douglas

unread,
Jan 27, 2009, 11:19:54 AM1/27/09
to Brighton New Media
@Premasagar do you mind if I half inch that code and turn it into an ExtJs
extension?
:)

w://

2009/1/27 Premasagar Rose <p...@dharmafly.com>

> Leo Brown said (@ 27 January 2009 12:32:44):

Premasagar Rose

unread,
Jan 27, 2009, 11:22:56 AM1/27/09
to Brighton New Media
Wayne Douglas said (@ 27 January 2009 16:19:54):

> @Premasagar do you mind if I half inch that code and turn it into an ExtJs
> extension?
> :)
>
> w://

Half-inch away :)
P

Leo Brown

unread,
Jan 27, 2009, 11:36:00 AM1/27/09
to Brighton New Media
Sweet! Do it!

Prem doesn't mind, it's open source right? ;)

-----Original Message-----
From: bnmlist...@brightonnewmedia.org
[mailto:bnmlist...@brightonnewmedia.org] On Behalf Of Wayne Douglas
Sent: 27 January 2009 16:20
To: Brighton New Media
Subject: Re: [BNM] Geo data

Aegir Hallmundur

unread,
Jan 27, 2009, 12:31:53 PM1/27/09
to Brighton New Media
>
> Given that the Royal Mail is a government owned company, does it not
> have a duty to make money for its shareholders by monetisation its
> assets, of which the PAF is a good example.
>

It's a strong argument, but then so is allowing UK individuals and companies
free use of the data, becoming successful, employing people and thereby
generating more revenue for the country. :)

Alan Braddish

unread,
Jan 27, 2009, 7:12:09 PM1/27/09
to Brighton New Media
For all those that like cats/kittens...you might enjoy this:

Live Kittie Webcam!!

http://www.pleaseretweet.com/live-webcams/live-kitten-webcam/

Reply all
Reply to author
Forward
0 new messages