Home > Postcodes > New Zealand Postcode Database (V2)

New Zealand Postcode Database (V2)

September 14th, 2007 Leave a comment Go to comments
[?]

I’ve done a bit of work on the database, added a bit of information and corrected mistakes.

Thanks to Owen and others for help with the data.

If you find this data useful, please donate.


What’s new in V2

  • More accurate
  • Added GPS co-ordinates
  • Added PO Boxes and Private Bags
  • Added Rural postcodes
  • Removed regions (as some datasources labeled a city/town as one region and others differed.)

I’ve also taken the opportunity to include CSV and MSSQL formats, as well as MySQL.

History

I originally created the database as I needed street and suburb data for a project I was doing. No one else was stupid enough to spend that much time on it, so I took it on. NZ Post still has their PAF data, but are unlikely to release a free database of the postcodes.

Original Post
More info on NZ Addresses

Downloads

MySQL
nzpostcodes_v2.sql.gz (655KB)
nzpostcodes_v2.sql.bz2 (445KB)

CSV
nzpostcodes_v2.csv.zip (1.07MB)

All efforts have been made to ensure that there are no errors, but there are no guarantees, if you need 100% accurate data please buy NZ Post’s PAF data.

[UPDATE 20/04/08]
As a few people have pointed out, there was no suburb data in the MySQL database version of the postcode database. This has now been fixed. Sorry about the problems and how long it’s taken me to get around to fixing it.

Categories: Postcodes Tags:
  1. December 5th, 2008 at 13:54 | #1

    @Richard

    Thanks for the comment, but this is what I did with v1. It was horribly inaccurate and took me ages to fix up import problems as PDF->text didn’t work well.

    The database I have now has a lot more information including long/lat coords for streets, which cannot be parsed easily from the PDF.

  2. December 5th, 2008 at 13:57 | #2

    @Chris

    This is the break down that I get from the database:
    359 – urban
    692 – rural
    687 – PO Box

    1738 postcodes

  3. December 5th, 2008 at 13:59 | #3

    @Peter

    If you use the rural table from the MySQL db then you’ll find that 3288 is RD8 Hamilton. CSV file only has urban street addresses.

  4. December 5th, 2008 at 14:05 | #4

    @Brett

    Thanks for this, I will write a script to fix these up, they should be pretty easy to spot. I’ll try and get an update this weekend if I get time.

  5. Colin
    January 6th, 2009 at 15:47 | #5

    All great work. NZ post don’t make it easy to extract the data. The PDFs ( from NZ post) can be by Region but you have not added it as a field. This would be the gold, as most reporting is done by region. Are you able to add this field to the data?

  6. Jo
    March 3rd, 2009 at 13:02 | #6

    This is fantastic, and I really appreciate your efforts. The postcodes are one peice of the puzzle for a project I am working on, the other being SNZ mesh blocks. Are you able, or do you know anywhere, where these two have been aligned?

  7. Melanie
    August 17th, 2009 at 10:40 | #7

    Hey, how current is this postcode list?

  8. Will
    August 24th, 2009 at 10:09 | #8

    Just dropping a note of thanks, awesome to see helpful projects like this, keep up the good work.

  9. Lee
    September 1st, 2009 at 19:55 | #9

    Thanks for your efforts, appreciate it

  10. Charles Sitwell
    October 23rd, 2009 at 16:02 | #10

    This is just what I was hoping NZPost would provide when they introduced the new system. Since then I have been putting off the evil day when I would have to do it myself.
    My interest is I’ve set up databases for a number of not-for-profit groups to which I belong, with a button to look up the Postal code and insert it after they have typed in the address of a member.
    To use this data in the same way, would I need to pay and to whom and what about NZ Post copyright. I don’t want any suprises down the track. So I’m asking before starting what will still be quite a lot of work :-)

  11. Sam
    October 28th, 2009 at 21:47 | #11

    Thanks very much for the DB. It really helped a lot!!!!!!!!!!!!
    You are a legend mate!

  12. Sam
    October 28th, 2009 at 22:05 | #12

    Is there a way to determine the region by postcode e.g starting with a particular digit?

  13. Alex
    April 12th, 2010 at 16:00 | #13

    You are a star. Saved me a heap of time and money

  14. April 25th, 2010 at 19:43 | #14

    Thanks heaps. Do you have a phone number db to by any chance?

  15. June 17th, 2010 at 23:03 | #15

    You. Are. A. God.

    Thank you so much!

  16. June 17th, 2010 at 23:16 | #16

    To everyone who wants to associate suburbs with region (no matter the accuracy) do the following;

    1) Import the V1 version of the postcode database
    2) Import the V2 version of the postcode database
    3) Add a column to the suburbs table from the v2 database called regionid INT(11)
    4) Run the following SQL (note I appended “location_” to the start of all my V2 tables, and renamed the V1 table postcodes_v1):

    UPDATE location_suburbs, location_regions, postcodes_v1 SET location_suburbs.regionid = location_regions.regionid WHERE location_suburbs.suburb = postcodes_v1.suburb AND postcodes_v1.region = location_regions.regionid

    Hope this helps… all I’m looking for is a nice way to let people who register on a site pick a region and suburb!

  17. Joe
    June 30th, 2010 at 16:57 | #17

    Or you can use this to extract the postcode from the NZ Post PDF
    http://www.srmiller.net/nzpostcode/nzpostcode2csv.zip

Comment pages
1 2 17
  1. September 14th, 2007 at 22:50 | #1