A postgres/postgis script to create centroids for PSMA localities which are based on actual population concentration, rather than geometric centroids.
This process and resulting files are useful for web mapping applications for a quick rapid lookup set of usable starting points to centre your map on, or also as an alternative, updated reference set of coordinates for the locality centroids provided in GNAF
Uses new open PSMA GNAF and PSMA Administrative Boundaries datasets. Assumes you are using the GNAF Loader and Cleaned Admin Boundaries (for this version I have used the display boundaries as previoously created)
The basic principle I have employed here is that of clustering of sets of address points, the assignment of these clusters to their localities and then the identification of the largest cluster's centroid to act as the updated centroid coordinates.
This process takes ~30-45 mins.
This is never a perfect process! whilst every effort has been made to make a more usable centroid dataset than what currently exists for PSMA locality boundaries, this is but one methodology, it has it's flaws and doesn't work perfectly for all situations. It's up here for any suggestions or improvements.
But note, the process needs to be data driven and repeatable 4 times per year! I can dot push (and have done before) my way to a great dataset, but thats not the aim here!
You can run the script to get the result or just download the data from here:
Incorporates or developed using G-NAF ©PSMA Australia Limited licensed by the Commonwealth of Australia under the Open Geo-coded National Address File (G-NAF) End User Licence Agreement.
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 and GNAF tables into Postgres
- You have run the psma-admin-bdys locality clean scripts to create the simplified boundaries.
- Will assume you have the gnaf and admin-bdys schemas populated with data as per above in a psma_YYYYMM Db. This data will be created as new tables in the admin-bdys schema
- Postgres 9.x
- PostGIS 2.1+
-
Trimming the boundaries to the coastline removes a small number of bay or estuary based localities.
These have very few G-NAF addresses. -
As an alternative you could perform this operation on the raw PSMA localities file instead.