best way get all addresses near a postcode?

Hi Chris,

You need the expensive Postzon Data:

There is a campaign to make this information freely available (as it is for ZIP codes in the USA):

http://www.freethepostcode.org/

Cheers, Olly.

Chris -

Chris -

A database with geometric types built in would be the best option, but assuming you don't have that...

(And I'm only brainstorming here, I haven't tried any technique or looked at Geokit.)

It might be less "expensive" to pull records from the database where the latitude or longitude was plus or minus 10 miles from a point and then calculate the geometry on those records to determine which are actually 10 miles from the point and sort them. Basically, retrieve a rough square and then narrow it down to a precise circle. It would save you from performing the geometry on every address in the database, including addresses on the other side of the planet.

Kevin Skoglund

Postgresql (http://www.postgresql.org/) has geometric types and
functions.

Be prepared for a bit of work. For example with postgis you can do a proximity search but the sql can get rather complex, and you have to translate points into meters, miles, or whatever unit of measure you are after. A search of the postgis archives should turn up pretty much everything you need.

What we did was use the perl code from geocoder.us to put the whole US TIGER dataset into a dbm file, and used that to get the lat/long for an address. It's not complete so we would fall back to the google api if it wasn't found. The google geocoding api and all other free api's have a limit on how many queries you can do per second, so if you are geocoding a large number of addresses you are better off having a local database to geocode against.

Chris