- Logging is now written to locality-clean.log in your local repo directory as well as to the console
- Added
--psma-version
to the parameters. Represents the PSMA version number in YYYYMM format and is used to add a suffix to the default schema names. Defaults to current year and latest release month. e.g.201611
. Valid values are<year>02
<year>05
<year>08
<year>11
, and is based on the PSMA quarterly release months - All default schema names are now suffixed with
--psma-version
to avoid clashes with previous versions. e.g.gnaf_201611
- locality-clean.py now works with Python 2.7 and Python 3.5
- locality-clean.py has been successfully tested on Postgres 9.6 and PostGIS 2.3
- Note: Limited performance testing on Postgres 9.6 has shown setting the maximum number of parallel processes
--max-processes
to 3 is the most efficient value on non-SSD machines
- Note: Limited performance testing on Postgres 9.6 has shown setting the maximum number of parallel processes
- Code has been refactored to simplify it a bit and move some common functions to a new psma.py file
Some utils to make it easier to use the PSMA's Administrative Boundaries
A Python script for creating a clean version of the Suburb-Locality boundaries for presentation or visualisation.
Trims the boundaries to the coastline; fixes state border overlaps and gaps; and thins the boundaries for faster display performance in desktop GIS tools and in browsers.
This process takes ~30-45 mins.
Coastline improvements
State border improvements
The cleaned localities are not well suited to data processing as they have been deliberately thinned to improve display performance.
A better dataset for processing is the admin_bdys.locality_bdy_analysis table that gets created in the gnaf-loader process
You can run the script to get the result or just download the data from here:
Incorporates or developed using Administrative Boundaries ©PSMA Australia Limited licensed by the Commonwealth of Australia under Creative Commons Attribution 4.0 International licence (CC BY 4.0).
- You will need to run the gnaf-loader script to load the required Admin Bdy tables into Postgres
- Postgres 9.x (tested on 9.3, 9.4 & 9.5 on Windows and 9.5 & 9.6 on OSX)
- PostGIS 2.1+
- Python 2.7 or 3.5 with Psycopg2 2.6
Trimming the boundaries to the coastline removes a small number of bay or estuary based localities. These have very few G-NAF addresses.
These localities are:
locality_pid | name | postcode | state | addresses | streets |
---|---|---|---|---|---|
NSW524 | BOTANY BAY | 2019 | NSW | 1 | 12 |
NSW2046 | JERVIS BAY | NSW | 0 | 5 | |
NSW2275 | LAKE MACQUARIE | NSW | 1 | 67 | |
NSW2627 | MIDDLE HARBOUR | 2087 | NSW | 3 | 23 |
NSW3019 | NORTH HARBOUR | NSW | 0 | 11 | |
NSW3255 | PITTWATER | 2108 | NSW | 5 | 31 |
NT26 | BEAGLE GULF | NT | 0 | 0 | |
NT75 | DARWIN HARBOUR | NT | 0 | 0 | |
QLD1351 | HERVEY BAY | QLD | 0 | 2 |