Automobile Collisions Involving TTC Vehicles

Eric Lum
SA8905 Geovis Project, Fall 2019

Toronto is the largest metropolis in Canada, attracting people from far and wide. As such, there are many forms of transportation that pass through the city including cars, bicycles, public transit, regional trains and many more. The Toronto Transit Commission (TTC) is one of the main methods that people rely on, as millions ride their services each and every day. All of these forms of transportation must share the roads, and from time to time collisions occur. This project aims to animate collisions between TTC surface vehicles such as a bus or streetcar, with another form of transportation (not including pedestrians). This visualization will be on the web-mapping service Carto, where a time series map will be produced on the various TTC related collisions.

The collision data for this project was obtained from the Toronto Police open data portal. The “TTC Municipal Vehicle” dataset that was used is a subset of the “Killed and Seriously Injured” dataset, as these are the specific types of collisions that were collected. The data is available for the years 2008-2018, but only the past five years from 2014-2018 were used for the sample size of the project. Information on the collisions provided in the dataset include the latitude, longitude, intersection, vehicle collision type, time, date, year and neighbourhood it occurred in.

The first step of getting the time series web map to work is to create a map and import the data into Carto. The collisions data was downloaded from the Toronto Police as a .csv file, which can easily be uploaded to Carto. Other supporting data used for this map includes the City of Toronto boundary file retrieved from the City of Toronto open data portal and the TTC routes which were retrieved from Scholars Geoportal. In order for these shapefiles to be imported into Carto, they must either be uploaded as .ZIP files or converted to another supported format such as JSON file. Once all the data was ready, it was uploaded through the “Connect Dataset” label shown below.

The next step was to geocode the collision locations with the latitude and longitude provided in the collisions .csv file. This was done through Carto’s geocode feature shown below. To do this, the layer with the data was selected and the geocode option was chosen under the “Analysis” tab. The fields for latitude and longitude were then input.

Once geocoded, the “Aggregation” method for the data needed to be chosen. As this is a visualization project over a span of years, the time series option was chosen. The “Style” also needed to be set, referring to how the points would be displayed. The dataset contained information on the different vehicle types that were involved in the collisions, so the “point colour” was made different for each vehicle. These functions are both shown below.

The same “Style” method for visualization was also applied to the TTC Routes layer, as each type of transportation should be shown with a unique colour. The last part in animating the data is to choose the field for which the timer series is to be based on. The date field in the collisions .csv file was used in the “Widgets” function on Carto. This allows for all the data to be shown on a histogram for the entire time span.

To finalize the map, a legend and basemap were selected. Once happy with my map, I made it public by enabling the “Publish” option at the bottom of the interface. This generated a shareable link for anyone to view.

A snapshot of the final time series map is shown below.

Thank you for viewing my blog post!

To access the full web map on Carto, the link is provided here:

https://ericlum24.carto.com/builder/00c16070-d0b8-4efd-97db-42ad584b9e14/embed