Crime Types in Berkeley (the Leaflet Way!)

One thing that strikes me particularly about Berkeley is how crime-intensive it is in spite of being the most liberal, relatively densely populated and student-centric cities in the U.S. Therefore, to get a better sense of the crime type, I used the leaflet to make a web map of different types of crime in Berkeley. I pulled the CSV file from Open Berkeley, cleaned it by pulling out the coordinates and type of crime, and finally converted it to the GeoJSON file. The geojson was then plugged within leaflet to make the following web map.

The challenging part of the exercise was to find 18 different colors to code the different kinds of crimes in Berkeley. Most colors aren’t vastly unique – which is why the color ‘palette’ for my map might not be as tasteful as I’d like it to be.

Is it safe to live in Berkeley?

Having lived in the Berkeley for the past 1 year, I am beginning to realize the city of liberals and pot-heads isn’t necessarily as safe as I’d assume it to be. The latest app, Nixle from Berkeley Police Department and the University of California, Berkeley seems to be sending me emails about sexual assault, armed robbery and break-ins constantly — but I can’t seem to figure out where crime occurs most.

I pulled data on calls made to the Berkeley Police Department over the past 6 months (180 days) from the open data portal of City of Berkeley to see if I could understand where crime occurs the most. I used Python to isolate the location coordinates and type of crime over the past 180 days, and then imported it to Carto to create the map.

Choosing what kind of map to place it in was challenging, because I was trying to respond to two questions:

  • Where crime occurs the most?
  • What kind of crimes are most common and where?

Having thought this through, I decided to show this in two maps instead of one. In the first map seen below, we are able to identify that crime is most common in central Berkeley and closer to the university campus. It becomes less frequent as we move towards North or South Berkeley, and almost becomes zero near Albany and El Cerrito. This could be because of the fact that residents of Albany and El Cerrito do not call BPD to report crimes.

In the second map, I was keen to understand what kind of crime is more common, and therefore, decided to map crimes by category. I was able to use the same dataset that resulted in the map below.

Although the second map is slightly more difficult to understand, it was clear that the most common type of crimes are motor vehicle theft and burglary. This was great information — I realized I definitely need to be more careful about locking up my bike and parking my car!