0

Is it possible to query a UK Postcode Database that is available offline and gather Geo Coordinates with JavaScript?

I am under the impression that the database is too vast to do this without online/local database management.

Has anyone found a solution for this problem?

Thanks.

EDIT:

The data will need to be used by a private organisation and does not need to be either hugely accurate nor updated regularly. (Basically the user needs to find the nearest location to their specific postcode - < 10 locations). I Think my concern is seeing the 550+mb databases.

It also needs to work purely in the browser offline using JavaScript. JSON format would be preferred.

Thomas
  • 523
  • 2
  • 9
  • 23
  • Hi Thomas, This is possible but before I answer, are you building this for use by a private company or public organisation in the UK (the answer would lead to differing data sources)? – Al Mills Apr 28 '14 at 13:30
  • Private UK Company. Please see my edited post for more details. – Thomas Apr 28 '14 at 14:15

2 Answers2

2

This is possible and there are few choices but first a few questions.

  • To what level of accuracy do you need the coordinates
    • The more exact, the more it will cost
  • How much time and effort do you want to put into long term maintenance
    • The data is regularly updated so make sure you have a business process in place
  • Are you building a solution for an existing company, or trying something out as a startup?

It is a large amount of data, but is manageable. The practicalities depend more upon the amount of time and money you want to invest.

There are two approaches:

1) Build your own

If needing premise level coordinates, you'll need to get a copy of the postcode file from the Royal Mail here and depending upon your level of accuracy you'll then need to also grab a supply of coordinate information from someone such as Ordnance Survey.

Load and link together the supplies into some sort of database or other store you are comfortable working in and make sure this process is easily repeatable once a month when the data comes through.

For just postcode level, I think the Code-point Open data should be good for you. If you are not worried about individual premises and postcode level is good enough. That comes to about 150MB in CSV files but you can get it a lot smaller than that by just storing the data you need.

The next step and develop a look up mechanism. The quality of your look up will depend upon your use case. If you are just after a rough location from the postcode this will be simpler than if you are after it down to the nearest cm and need a full premise address.

2) Go third party.

There are many companies around that can do this for you. My company - Experian Data Quality - provide tools to allow you to do this offline as a library or SOAP based service.

Once integrated, they will allow your users to quickly and easily find their correct address and then in the same call enhance the address with location (and many other types) of information.

This will cope with typos, data updates etc. Fill in the form or give us a call for a demo if sounds useful http://www.qas.co.uk/solutions/data-quality-software/data-capture/address-checker.htm

There is sample integration code available that will allow you to hook it into your website with JavaScript.

Al Mills
  • 1,072
  • 6
  • 22
  • Thank you for the thorough response. The data will need to be used by a private organisation and does not need to be either hugely accurate nor updated regularly. (Basically the user needs to find the nearest location to their specific postcode - < 10 locations). I Think my concern is seeing the 550+mb databases. It also needs to work purely in the browser offline using JavaScript. JSON format would be preferred. – Thomas Apr 28 '14 at 14:09
  • Great, sounds like Code-point open is probably the best solution. Link in the edited answer. There are only a few thousand postcodes to look up from so you can get it quite tiny if you pack it up in a decent format – Al Mills Apr 28 '14 at 16:38
0

You can buy the database from the Royal Mail:

http://www.poweredbypaf.com/end-user/products/data-products/paf-raw-data/

This is the official database from the Royal Mail and can be downloaded and used offline.

Mark
  • 2,184
  • 1
  • 16
  • 28
  • Thanks, I should of been more clear. I know of the postcode databases. I actually have a 575mb copy of the data. I was asking for a practical solution for handling the data. Apologies for lack of clarification, I have updated my post to reflect this. – Thomas Apr 28 '14 at 14:11