This project analyzes the well-resourced status of SA2 regions within a given SA4 area in Greater Sydney. It uses various datasets to compute composite scores based on public amenities, economic indicators, and services.
scripts/main.pyβ Orchestrates the pipeline executiondata_loader.pyβ Loads CSV and shapefile data into PostgreSQL/PostGISanalyzer.pyβ Contains theanalyze_sa4function that processes an SA4poi_fetcher.pyβ Fetches and processes POI data using a mock API
data/β Contains input datasets such as Population.csv, Income.csv, Businesses.csv, and shapefilesoutput/β Stores generated score maps, correlation plots, and CSV outputsnotebooks/code.ipynbβ Jupyter notebook version of the analysis for interactive developmentREADME.mdβ Project documentation
- Python Libraries:
pandas,geopandas,sqlalchemy,matplotlib,shapely,requests - Database: PostgreSQL with PostGIS for spatial data support
-
Data Loading
- Run
data_loader.pyto import all CSV and shapefiles into the PostgreSQL database. - This creates and populates tables like
population,businesses,income,stops,school_catchments.
- Run
-
SA4 Analysis
-
Call
analyze_sa4(sa4_name)frommain.pyor the notebook. -
For each SA2 within the SA4, compute the following:
- Business density per 1000 people
- Public transport stop count
- School catchment intersection count
- Point of Interest count (mock data)
-
Z-scores are computed and normalized using the sigmoid function:
Final Score = sigmoid( z(business per 1000 people) + z(stop count) + z(school count) + z(poi count) )
-
-
Output
- A CSV of scores is saved in
output/ - A PNG map of SA2 scores with top-3 annotated is generated
- A PNG scatterplot of score vs income with correlation coefficient is also saved
- All scores are written to a PostgreSQL table for reuse
- A CSV of scores is saved in
python scripts/main.py