Data for this visualization comprises approx 21.2 million parking infractions issued over the last 8 years in the City of Toronto. Of that we focus on just the Toronto and East York Community Council Area, which represents 68% of the total infractions issued.
The app gives you an interface for analyzing the parking ticket data. Use it to answer specific questions about parking infractions, or look at broad trends. It's flexible.
For example: How many infractions were issued on 'Elm St' on Saturdays and Sundays at 8pm in the evening?
Now let's look at a broader trend (this example will only work on the desktop version). We're interested to know: how does the intensity of the ticketing process change geographically at midnight vs all other times? If you did the Elm St example:
Notice that overall the highest intensity of ticketing (the darkest red on the heatmap) occurs in the downtown core / financial district. These are highly trafficked areas with many commuters visiting during the week for work -- you can get a sense of this by noticing that Mon - Fri are the most frequently ticketed days of the week as well.
So what happens at midnight?
Hopefully these examples give you an idea of the kinds of things you can do with the app.
As a naive approach, the risk is scored according to the divergence of the cumulative infractions issued per unit distance (based on the filter settings, of course). As a metric this tells us where you're relatively more or less likely to receive an infraction, given that you've committed a parking offense, penalized sharply by the overall length of the roadway (and thus the number of available parking spots) you might choose to park on.
Unfortunately, the city releases the parking ticket data only once per year. The archive can be found here. Expect an update in Q1 2017 when the new data comes out.
Everything! From failing to display, parking on private property, all the way to parking more than 30cm from the curb (yes, that's a thing).
This is actually a static site! So depending whether you're on desktop or on mobile you might notice it's feels slightly faster/slower, since all of the computation is happening on the client side in your device.
Having a serverless app like this for data exploration has some great use cases, particularly in the enterprise where it enables you to quickly share analyses without having to set up server architecture (which can take weeks/months). With some small modification, you can run an app like this without even a local web server -- all the end user needs is a modern web browser and access to a folder containing the source.
Doing so would have quadrupled the size of the payload. Also, there's only a small amount of variance year over year in terms of the infractions issued -- parking enforcement is suprisingly consistent! So although we would prefer to include it for completeness sake, at a high level it made sense to leave it out.
The desktop version is more feature rich, and the expected performance better. You can't, for example, tap on a street to select it in the mobile version, since this makes zooming difficult. On desktop you can filter over the entire dataset to view how the heatmap changes e.g. by hour or day of week -- on mobile you can only filter information for a given street. As well on desktop, hover events also make it easier to locate specific streets.
We serve a one-time payload of approx 4mb (uncompressed) to the user, containing a partially aggregated set of the infractions, roughly 200,000 records, in addition to the GeoJson extracted from shapefiles provided by the city. Vector tiles for the base map are provided by MapBox and OpenStreetMap. Everything else is happning on the client side.