This repository is for the ASAP February 2025 away day coding challenge. It is a web application created with Flask that is used to display an interactive JavaScript map created with Folium (a Python API for the Leaflet JavaScript library). Your task will be to extend this app to make it more useful.
-
Fork the repository to your personal account and clone the repository
-
Create a virtual Python environment for the project (tested on Python 3.11)
-
Navigate to the top level project directory and install the requirements using
pip install -r requirements.txt -
From the top level of the project directory, run the app using
flask run -
Access the app from
http://127.0.0.1:5000/
-
datacontains:local_authority_district_boundaries.geojson: this contains the spatial data for each local authority.median_annual_pay.tsv: this contains the median annual pay for each local authority where available, from 2004 to 2024.
-
The
mappingmodule is used to process the data:mapping.prep_datais used to read and process the median annual pay data into a Pandas DataFrame.mapping.folium_mapis used to convert the spatial data into a GeoPandas DataFrame, which is then merged with the annual pay DataFrame. This merged dataset is then used to create a Folium Choropleth map.
-
app.pycontains the Flask code. It calls functions frommapping.folium_mapto generate a Folium Choropleth map, which is then rendered as an iframe insidetemplates/home.htmland served when callingflask run. -
notebookscan be used as a space to conduct exploratory data analysis and prototype Folium maps. It contains an example notebook.
When you have finished the challenge, push your changes and open up a merge request.