UK Crime Map

Using data from data.police.uk

Intro

We use data from data.police.uk to build a heatmap of crime across England,Wales and Northern Ireland

Hardware

This is on a single rpi4 with the following setup:

  • Solr Heap 1Gb
  • SD Card 32Gb SanDisk A1
  • 4x CPU
  • 4Gb RAM

What it shows

The heatmap is coloured from red to green, red for higher count of crime to green showing lower counts.

Moving the mouse over the map will show the crime counts for that specific point on the map. Zoom in for greater granuality and detail

As you drag the map, or zoom/out, the bottom right contains a count of totals overall and for each crime type for the whole of the visible map shown on the screen.

To reduce the detail to a specific time period, or a specific or set of crime types, use the filter on the top right of the screen. Additionally you can choose a difference base map, e.g. Google satellite to gain greater perspective by hovering on the layer icon.

How it works

There are three main components, varnish, nginx and solr

In addition is the custom code I wrote including a jsonp implementation of UTFGrid, and associated solr Response Writer and Search Component that relies heavily on converting lat/long to morton code or z-order In addition to the UTFGrid Response Writer, I also wrote the png Response Writer for the heatmap overlay images.

Contact me if you're interested in more detail.