A mapping of Australian postcodes to federal electorates according to the Australian Electoral Commission.
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.9sother
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
To download data sign in with GitHub
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
|
|
|
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