Spatial Pattern Analysis Machine
Index > software > SPAM
How it works
Raster output files
Making it work
DownloadingThis page contains details of a software package written in Visual C++ to analyse high volume crime data. A limited version is available to download, and a free fully working version is available to anyone who has a reasonable interest in it. This is available on e-mail application to the author. This process to obtain the full version is only intended to keep me updated as to who is interested and using SPAM.
The limited version is identical to the full version except that it only allows a maximum of 200 points to be examined by the program at any one time. If you need to analyse less than 200 points then away you go! To get a copy of the full version (not 200 point limited) first try the limited version. You may find it is not suited to your work and then you will save both of us time. If you want the full version, send an e-mail to jerry.ratcliffe@bigfoot.com placing the words SPAM request in the subject area and in the main body of the message outlining your research/policing interest and background.
All about SPAM
What is SPAM?
SPAM (Spatial Pattern Analysis Machine) analyses crime patterns through the use of a moving window local search technique linked to a quartic kernel algorithm to provide a hotspot detection program. Input files are simple ASCII delimited co-ordinates, and output files are specifically written to be integrated into MapInfo. The raster creation system outputs MapInfo MIF and MID files.How does it work?
Well you could write a small book on crime analysis techniques, however this page will simply outline how SPAM works with georeferenced point data. First start with some crime locations. Figure 1 shows some crime incidents on a street map.
![]()
FIGURE 1 Grey bits = roads, red dots = crime locations!
Once all the points are input to the system, via a text delimited file, then the program works out some basic calculations. It then goes on to generate a default grid (which you can change if you want to). You will find that most of the settings in the program are adjustable via the menu system and toolbars. Grid shown in figure 2 below.
![]()
FIGURE 2 A grid over the crimes. Default grid uses the MBR (Minimum Bounding Rectangle) of the crime points.
The big part of the program is coming now. At each grid location a definable size circle is placed over the data, centred on a grid lattice intersection location (figure 3). You can adjust the circle radius.
![]()
FIGURE 3 A circle (or number of different sized circles) is placed over each intersection.
There are currently four choices of algorithm in the current release of this program. The simplest algorithm is a simple density based on the number of crime events detected within the circle (figure 4).
![]()
FIGURE 4 A simple density estimation is based on the number of events within the circle.
Alternatively, you may choose the quartic kernel estimation process. This algorithm calculates an intensity value for each point in the circle. The closer the point is to the centre of the circle (grid lattice) then the higher the value. A final value for each circle is the sum of these intensities.
![]()
FIGURE 5 A more complex quartic kernel algorithm. Events are weighed and incidents closer to the centre contribute a higher value.
Raster output files for MapInfo
One of the outputs of the program are two MapInfo Interchange MIF and MID files. The raster output files are the results of the algorithm taken at each intersection with the fixed circle radius. When the same radius is used at each location, a raster image can be constructed with each cell containing the value of the intensity (or density) calculation for that location.An example is below:
![]()
FIGURE 6 SPAM raster output showing residential burglary crime hotspots in the Meadows, Nottingham, UK.
OK, so once I've got the program, how do I make it work?
The program doesn't come with a help file, as I'm too busy to write one. However the basics are as follows:
- Get a text delimited file or crime location x and y co-ordinates. Do not include a header row or anything, just a simple list of x and y co-ords in ASCII format metric co-ordinates. Acceptable delimiters are commas, semi-colons, colons and pipes (|). Only integer values are accepted. Example:
344587, 477812
344510, 487001- Look at the graphics window and see if the points look like your crime distribution. If they don't, you have a problem with your data! The inner border in the graphics window shows the study area, which is the same as the MBR of the data set (Minimum Bounding Rectangle). This can be adjusted later.
- Bandwidth and cell size:
Selecting a bandwidth and cell size is an exercise for the user. STAC suggest about 220 metres for a US city urban area, and around 200 metres has worked well in studies in Nottinghamshire UK. The cell size is the distance between circle centres. An overlap of 0.7 or 0.8 of a radius seems to work fine. For an 0.8r overlap, choose a grid size of 40 metres for a radius of 200 metres.- Select Analysis > Hotspot surface from the menu bar. Question mark buttons tell you a bit about each option. Next progresses onto the save options. Select the MapInfo files option to create MapInfo Interchange files. Select a filename for the log file. All other output files use this as a basis for the output files by changing the file extension. Be aware of this when you select a log file name. Existing files are overwritten without warning! You will also be asked for a metric co-ordinate system for the table. This has been added to help users from other countries and the old colonies!
- The program runs. Two MapInfo Interchange files are now ready to import into MapInfo. In MapInfo select Table > Import... and import the Mif and Mid files. Save the table locally and create a new Mapper for it. You will see a fine mesh of black boxes which represent your grid cells. The centre of each box is the centre of a search circle. If you don't see a mesh of black lines then you may have downloaded the version that produces a transparent area with no border. This is to help with the thematic map stage next.
- Use Map > Create thematic map... in MapInfo to draw a thematic map. I recommend removing the black boxes layer in the layer control and retaining the thematic image. Draw your image with gradual colours and without borders.
- Print your map and impress your colleagues!
![]()
SPAM Download
DOWNLOAD the 200 point version for evaluation.Evaluation means just that...no commercial or regular police intelligence use. If you want to use SPAM (or the fully integrated MapInfo version Hotspot Detective), e-mail the author.
For more details, or if you find that you require other files such as MFC42.dll or other DLLs, e-mail the author.
![]()