Charting PDX Crime Reports

Utilizing Mapbox and Geocoding to Visualize PPD Dispatches

I've built several visualizations with static data. I wanted to experiment with real-time data. I follow PDX Police Log on Twitter, which is a police scanner feed. I thought this was pretty interesting, so I wrote a persistent listener that uploads these Tweets to a database. An open socket connection updates this data in realtime.

I use Mapbox to generate the chart. Mapbox is really great- it's feature-rich, great documentation, and free to use for projects like this. You may have noticed that the Twitter account provides the address of the event. I use Mapbox's geocoding tool to convert the address to latitude and longitude and then create the markers on the map using the latitude and longitude. The tool is not always successful - they tweet out a few different address formats and some formats are easier to parse and geocode than others. In particular, address formats of 'STREET 1 / STREET 2' rarely return correctly.

Update: 3/15/2023

Unfortunately, Twitter has made the decision to no longer allow developers to freely interact with their API, so this project no longer functions as intended.


Date Address Incident Type
03/14/23 02:42 PM 2200 LLOYD CENTER Vehicle Stolen
03/14/23 02:40 PM 1300 N SKIDMORE ST Vehicle Stolen
03/14/23 02:30 PM 5800 SE 88TH AVE Vehicle Stolen
03/14/23 02:26 PM SE DIVISION ST / SE 122ND AVE Accident
03/14/23 02:26 PM 1600 SE 12TH AVE Burglary
03/14/23 02:22 PM 9300 SE SALMON CT Shots Fired
03/14/23 02:22 PM 700 NE 7TH AVE Unwanted Person
03/14/23 02:20 PM SE FLAVEL ST / SE DEARDORFF RD Accident
03/14/23 02:20 PM 7500 SW BARBUR BLVD Vehicle Stolen
03/14/23 02:16 PM 8100 BLOCK SE MITCHELL ST Parking Problem
03/14/23 02:16 PM 3600 NE 137TH AVE Vehicle Stolen
03/14/23 02:14 PM 2400 SE 139TH AVE Vehicle Stolen
03/14/23 02:12 PM 1500 N TOMAHAWK ISLAND DR Theft
03/14/23 02:12 PM 2400 SW ARDEN RD Vehicle Stolen
03/14/23 02:06 PM SE KNAPP ST / SE 85TH AVE Suspicious Subj, Veh, Or Circumstance