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 theOther 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