One of my employers, the SCCJR, has started a new project: Community Policing in Scotland. The project is quite a modern project, in terms of academia, in that it combines many different multimedia elements such as video, audio and photographs to describe the routes Community Police Support Officers (CPSO’s) take on their ‘beat’. The police officers are given video recorders and cameras to use during their patrols, they then upload them via the website ‘members’ area.
In these recessionary times, we are always looking for ways to save cash on projects, or shelve them for a while, and this was no different. We wanted to track the CPSO’s on their patrols using GPS, we could then record their routes and build up an accurate record of their routes in relation to crime areas. The idea was to use small GPS tracking devices and record where they walk. The officers would then upload the GPS data to the website, where it gets added onto a google map. The project co-ordinators could then view the routes taken by the CPSO’s over multiple days. In addition to this we wanted to plot crime stats by postcode to see if the officers deliberately avoided areas of high crime.
The one problem is that I just don’t have the time to do this. I know the theory, and have actually done most of the legwork before using the Google Maps API with PHP&MySQL on the Global Gothic website, but time and monetary constraints have left us without the ability to do this part of the project.
…Enter the Computer Science Department at the University of Stirling. Every year they have a cohort of MSc students who need to undertake a final year project and dissertation. They request for projects to be added to a list for the students to choose from, and luckily enough we managed to snag ourselves a student!
We have had a few meetings to discuss our requirements and everything is a go! Here’s a breakdown of what should be an incredibly interesting project (for geeks like me anyway).
Part 1
- Create a simple, secure website (PHP sessions) to enable CPSO’s to log in and upload a GPS file (.GPX format).
- The System will then automatically parse the GPX file (it’s just XML really) and input it into the MySQL database
- The project coordinators can then log into the website and choose which CPSO they want to view the results from, and the date of the patrol (populated & filtered using AJAX).
- The results from the above query will then be plotted onto a google map.
- The coordinator can then choose to plot further routes on the same map.
Part 2
- Crime statistics will be provided in a CSV file, this will have the postcode in one column, and the number of crimes in the other column. The file needs to be uploaded, parsed, and entered in a database.
- The crime stats can then be plotted onto the google map, using different coloured ‘circles’ to denote an area (i.e red= over 10 crimes,yellow=5 to 9 crimes etc).
- The crime stats can be turned on and off using a button, so they can be overlaid with the routes from the first part of the project.
Sounds simple, eh? Well, yes and no. Both parts, taken separately are quite easy, but combining them in an easy-to-use interface will be the hard part methinks.
Stay tuned in a few days for another blog entry with some simple code to plot points on a google map using coordinates stored in a MySQL database. Probably quite boring stuff, but it’s easy to do, and there’s not that many examples out there.
And here’s a pretty(!) picture of how I envisage it will look when finished. Stay tuned to see the final version in the autumn. Click on it for a larger view!

