parking visualization

Recently, I spent some evenings slicing and dicing Toronto City Parking Infractions data for 2015 in Tableau 9.3. While working with built-in Tableau maps, I also ended up researching alternative tools that could generate a map visualization. In a discussion about mapping tools with LinkedIn friend, Alan Clark, an expert in this field, I was directed towards ArcGis which is a Geographic Information System for mapping and analyzing geographic data. At first glance, the features were quite appealing and I decided to try mapping the parking infractions data onto a map for easy visualization.

Data Preparation

I created a ArcGIS Online trial account to explore this further. The data set I used was from the Open Data program run by the City of Toronto. You can find parking data organized by year (2008 – 2015) here. The table below displays a few records to indicate what the raw data looks like:

tag_number_maskeddate_of_infractioninfraction_codeinfraction_descriptionset_fine_amounttime_of_infractionlocation1location2location3location4province
***873252015010115PARK-WITHIN 3M OF FIRE HYDRANT1001OPP11 CENTRE AVEON
***873262015010115PARK-WITHIN 3M OF FIRE HYDRANT1001OPP11 CENTRE AVEON
***09493201501013PARK ON PRIVATE PROPERTY302NR2425 JANE STON
***67358201501015PARK-SIGNED HWY-PROHIBIT DY/TM403N/SDUNDAS SQE/OYONGE STON
***87327201501015PARK-SIGNED HWY-PROHIBIT DY/TM403N/SARMOURY STW/OCENTRE AVEON

To prepare the data set for map based analysis and make it more readable, I made the follow changes:

  1. Removed all columns except location2 and province
  2. Changed column header location2 to street
  3. Under the province column, I changed ON to Ontario
  4. Added new city and country fields
  5. Created a “Total Fine” field by aggregating fines for same street.

 

Note that the total number of records in the parking data for 2015 was over 2 million and excel has a limit of 2^20 rows (1,048,576 to be exact). The files from Open Data were divided into 3 sets of CSV’s so either you can repeat your data preparation 3 times, once for each file or find a data management tool that can process 2 million records without causing performance problems. There are many tools that have data management capabilities including SPSS, openRefine, RapidMiner and if you are comfortable with programming, you can use R as well.

This is what CSV file looked like after the data preparation.

streetcityprovincecountryTotal Fine
1090 DON MILLS RDtorontoontariocanada643970
1 BRIMLEY RD Storontoontariocanada384740
410 COLLEGE STtorontoontariocanada377625
3401 DUFFERIN STtorontoontariocanada236690
45 OVERLEA BLVDtorontoontariocanada217040
40 ORCHARD VIEW BLVDtorontoontariocanada217005
35 BALMUTO STtorontoontariocanada215535
JAMES STtorontoontariocanada201270
20 EDWARD STtorontoontariocanada189070
18 GRENVILLE STtorontoontariocanada170140
2075 BAYVIEW AVEtorontoontariocanada157940
60 MURRAY STtorontoontariocanada151965
555 REXDALE BLVDtorontoontariocanada147970
LA PLANTE AVEtorontoontariocanada121790
100 KING ST Wtorontoontariocanada118225
2075 BAYVIEW AVtorontoontariocanada115120
401 COLLEGE STtorontoontariocanada111550
66 WELLINGTON ST Wtorontoontariocanada106820
150 DAN LECKIE WAYtorontoontariocanada104925
225 KING ST Wtorontoontariocanada101855

ArcGIS Mapping Steps

Now, I am finally ready to do the more exciting stuff in ArcGIS! A survey of data scientists found that they spend more than 60% of their time collecting, cleaning and organizing data and only about 10% mining the data. So, nothing extraordinary there, this was expected. After logging in to ArcGIS and proceeding to the Map module, I am greeted with the page below.

welcome_map_page

 

When I click on the Basemap menu, I was pleased to see several map options and decided to select Streets.

map_styles_jpg1

 

Then I clicked on the Add menu and selected Add Layer from File to add my prepared CSV file.

uploadcsv

I proceeded to add my CSV file and was prompted with the following dialog box. You can select whether the mapping should be based on address of Latitude/Longitude. In my case, I have the street address in my CSV, so I selected Address. I was glad that the tool was able to easily map the columns from my CSV directly to its Location Fields without me having to do additional changes to my data.

add_csv_layer

Unfortunately I seemed to have hit the limit of my ArcGIS public account. However, that’s ok, I can still plot the first 250 addresses on to a map!

csv_limit

Visualization – TOP 250 Revenue Generating Streets

Fortunately, the excel sheet was already sorted by Total Fine by street, so what I really got was a visualization of the top 250 parking related revenue generating streets in Toronto! The bigger the circle the higher the fine for that location. Based on the data, in total, there were 204,752 unique streets that had parking infractions. The single highest revenue generator was 1090 Don Mills Road with a grand total of $643,970. which is right next to Shops at Don Mills, an upscale mall.

This map is interactive! You can zoom in to look for specific streets

Below is a quick summary of the high revenue generating streets.

1090 Don Mills – Next to High end shopping plaza
# of Tickets – 2,797
Total Fine – $643,970
Avg fine/ticket – $230

1 Brimley Road – Next to Bluffers park
# of Tickets – 3,184
Total Fine – $384,740
Avg fine/ticket – $120

410 College Street – Sandwiched between 2 schools
# of Tickets – 941
Total Fine – $377,625
Avg fine/ticket – $400

2075 Bayview Avenue – Next to Sunnybrook Health Center
# of Tickets – 9,124
Total Fine – $274,600
Avg fine/ticket – $30

The visualization above is interactive and hosted on the ArcGIS platform and you can access it directly here. I encourage you to poke around the map to see if you can find any interesting patterns on how the Toronto City Parking authority is distributing parking infractions. There does seem to be a clear pattern of higher parking related revenue being generated close to hospitals, malls and schools. Perhaps there is a lack of parking facilities in this area? Or is this location highly targeted by parking enforcement officers for one reason or another?

In the future, I plan to drill down deeper into the available data to come up with conclusions about what the map visualizations tell us. Please share your feedback and comments below!

2 thoughts on “Visualization of Toronto Parking Infractions

  1. Faizan

    Interesting! The data preparation part is always tricky as it can affect the outcome of your analysis.

    Also, this goes to show how analytics can be an important tool outside the business sphere, i.e. to understand governance and policy development.

  2. Hi Salman, Great article and interesting speculation on revenue generated. You did a great job of showing how easy it is to visualize data on a map. Note that you could easily map all the data with a paid subscription and find other hotspots with a heat map too. Keep up the fine work, as I look forward to your next post. Cheers!

Leave a Comment