In this lab, you will complete tasks similar to what a geospatial analyst working for a department of transport or a city government might do
In this lab, you will complete tasks similar to what a geospatial analyst working for a department of transport or a city government might do - inform city leaders about traffic fatalities and injuries and give insights for urban transport planning. You will explore a data set of all recorded road collisions in Great Britain in the year 2019 provided by the UK Department of Transport with details about the circumstances of personal injury.
The major parts of the project are:
- Exploring and transforming the data, making numerical and visual reports
- Connecting data tables (accidents, vehicles, casualties)
- Grouping and aggregating data based on spatial relationships
- Visualizing the data on a map
- Automating the process so that it can be applied several times
- Answering geospatial questions
Requirements
All Python packages are allowed, but comment your code assuming the reader has no knowledge of extra packages that were not covered in lectures. There are 16 available points, but you only need 15 points for a full credit.
Data (for direct loading)
These links can be directly red and by panda/Geopandas. See the lab data folder for the spreadsheet with explanations of the different variables.
Accidents: https://www.dropbox.com/s/s9118iorsw2nn2i/Road%20Safety%20Data%20-
%20Accidents%202019.csv?dl=1
Vehicles: https://www.dropbox.com/s/ry0hnbf4quv5xhx/Road%20Safety%20Data-
%20Vehicles%202019.csv?dl=1
Casualties: https://www.dropbox.com/s/mu9a0wkzucd9nzf/Road%20Safety%20Data%20-
%20Casualties%202019.csv?dl=1
LSOA boundaries: https://www.dropbox.com/s/hh7wqyu0uxgomsn/Lower_Layer_Super_Output_Areas_%28D ecember_2011%29_Boundaries_Generalised_Clipped_%28BGC%29_EW_V3.geojson?dl=1
Assignment
You are a data scientist working project that reports to the city hall of several major cities in the UK:
City | Birmingham | Leeds | Sheffield | Bradford | Liverpool | Manchester | Bristol |
Your job is to report to each city informing them about the state of road safety in the city.
Task 0: Data filtering and cleaning (2 points)
Using of the three raw UK datasets provided, a unified data set is needed (i.e., join the three together on a common attribute) and then select a subset for the city of Birmingham to continue working with (refer to the variable look up table).
Task 1: Analysis of attributes (w/o consideration of geographical space) (2 points)
Report (i.e., plot) the frequency of road collisions for Birmingham for: 1) age of driver, 2) day of week, 3) and severity of accident. The outcome will be three separate plots. What ages are the most common for accidents? Which two days of the week are there the greatest number of accidents? Are most accidents severe or mild?
Task 2: Geospatial data processing (3 points)
Convert the coordinate information of collision points for Birmingham into a valid geometry column and convert the DataFrame into a GeoDataFrame. Read in the boundaries for the super output areas and then a new column is needed to contain the number of collision points within each area (for only Birmingham).
Task 3: Map visualization (3 points)
Visualize the 1) reported collision points for Birmingham on a map with super output areas (i.e., map two layers on top of each other), 2) the count of collision points for each super output area (i.e., choropleth map) using natural breaks to categorize the data, and 3) the count of collision points and average speed limit for each area (need to identify an interesting correlation for here, doesn't have to use count of collision points) for each super output area (i.e., bivariate choropleth map).
Task 4: Automation (3 points)
A function designed to automate tasks 1-3 for each of the 7 cities and verify that the same figures and maps are produced for Birmingham. (hint use def function(): )
Task 5: Geospatial questions (3 points)
1) Which of the cities has the super output area with highest density of collisions per area? 2) How many collisions are there within 5 km of the Department of Geographical Sciences (Long: :2.605248, Lat51.457140) in the city of Bristol?
3) If we considered 10 m around each collision point to be a "danger zone ", then how much total area of "danger zone" is there in each city? If danger zones overlap, then they should not count multiple times towards the calculation.
Hand-in
You must hand in a notebook with your code that includes/produces:
- Code for each task with appropriate comments/documentation
- Figures generated by your code (three graphs and three maps per city, 42 figures total). All figures should have appropriate titles and labels for the axes. Maps should have legends.
- Your responses to questions in tasks 1 and 5.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
The assignment involves multiple tasks so lets break it down step by step Ill provide you with a Python code template and explanations for each task Please note that this is a template and you may nee...See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started