Skip to content

openaustralia/aec_postcode_electorate_data

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%