openaustralia / aec_postcode_electorate_data

Postcode to Division mappings


A mapping of Australian postcodes to federal electorates according to the Australian Electoral Commission.

  • The redistributed column of the data is the electorate which will be used at the next federal electorate for the given locality. For states where there was no redistribution the column will be blank.9s
  • The other columne is the Other Locality(s) data from the AEC site.
  • To get a consolidated list of electorate/postcode mappings for the next election:

    select distinct state, suburb, postcode, coalesce(nullif(redistributedElectorate,""), electorate) as electorate from data

  • The list of postcodes is sourced indirectly from the G-NAF, by way of openaddresses.io. Download the au/countrywide (addresses - country) file in geojson format. Then: gunzip au_countrywide-addresses-country.geojson.gz jq -r '.properties.postcode' au_countrywide-addresses-country.geojson | sort -u > postcodes (Note: you'll need jq to process the geojson) then remove the first (blank) line.

Pull requests welcome.

Note that the scraper adds to the database so if for any reason a postcode is removed then there will be an old record that doesn't get updated. To fix this simply delete the database before a run.

This is a scraper that runs on Morph. To get started see the documentation

Contributors jamezpolley mlandauer

Last run failed with status code 255.

Console output of last run

Injecting configuration and compiling... [1G [1G-----> Python app detected [1G-----> Installing python-3.6.2 [1G ! Requested runtime (python-3.6.2) is not available for this stack (cedar-14). [1G ! Aborting. More info: https://devcenter.heroku.com/articles/python-support

Data

Downloaded 1607 times by pacmanspants sam-nolan-tearfund jamezpolley harleygray andie-theadventurer isaacm1994 mlandauer Jayce53 szeco geoffbromley natia-li Spinna23 tjejojyj admanami Cockatoo24 arkho-boop myvirtualplanet jmurdoch84 MisterGlitchFace Bongobenny MATaouk chrismawn jwilliamsnteu joshwright2049 RedArrowRising ppmeo cwbenn RedRubble duckpeas tommyq22 lukekfreeman Thammond2411 postbug joseoronos ammomarketing crooka81 grainne-breathnach hburtmorris BPitfield18 stevej098 emil7051 projectplanetaus paulieokay PiaTarestad John19111968 jmwelton artsjourno nickjones0001 Oxbridge2016 AdrianLW paulcoldrey smch95 dawesi magvich1234

To download data sign in with GitHub

Download table (as CSV) Download SQLite database (1.4 MB) Use the API

rows 10 / 17794

state suburb postcode electorate redistributed other
NSW
NUBBA
2587
Shortland
 
WA
FITZGERALD RIVER NAT PK
6346
O'Connor
 
NT
DARWIN
0800
Solomon
 
NT
ALAWA
0810
Solomon
 
NT
BRINKIN
0810
Solomon
 
NT
BUFFALO CREEK
0810
Solomon
 
NT
CASUARINA
0810
Solomon
 
NT
COCONUT GROVE
0810
Solomon
 
NT
JINGILI
0810
Solomon
 
NT
KULALUK
0810
Solomon
 

Statistics

Average successful run time: about 1 hour

Total run time: about 4 hours

Total cpu time used: 15 minutes

Total disk space used: 1.47 MB

History

  • Manually ran revision 16dcbe15 and failed .
    nothing changed in the database
  • Manually ran revision 16dcbe15 and completed successfully .
    17792 records added, 17729 records removed in the database
  • Manually ran revision 16dcbe15 and completed successfully .
    17731 records added, 2336 records removed in the database
  • Manually ran revision 096ee84a and failed .
    2336 records added, 1547 records removed in the database
  • Manually ran revision 399cc70d and failed .
    1547 records added in the database
  • ...
  • Created on morph.io

Show complete history