Posted on Wed 20 October 2010

OpenHeatMap of the Drug War in Mexico

OpenHeatMap is an open-source tool that lets you turn a spreadsheets into a maps. It is very user-friendly if you have lots of data because it allows you to zoom into the map, and if you’re like me and can never remember the exact location of important cities, when you hover your mouse over a region it shows you its name and the exact value you assigned it.

But best of all Pete Warden just updated OpenHeatMap with maps of Mexico at the municipality level. I decided to take advantage of this and built a HeatMap/Choropleth of the murder rate in Mexico for the last three years (the drug war started December 2006).

The spreadsheet I used to build the maps looks like this:

mex_muni_code value time
01001 3.1 2006
01001 3.9 2007
01001 5.7 2008
01002 2.4 2006
01002 2.4 2007

The mex_muni_code column corresponds to the combined state and municipality codes, the value column is the homicide rate, and time is an optional column if you want the map to have a slider so you can compare homicide rates over time. Once the spreadsheet is ready all you have to do it is upload it and you’re set to go.

In 2006 you can see how Michoacán turns red as La Familia wrests control of the state from the Zetas and also the end of the failed attempt by the Sinaloa Cartel to take over the drug trafficking routes of Nuevo Laredo. Notice how in 2007 the whole map pales considerably as it was the year with the lowest homicide rate on record, and how in 2008 the whole border region of Chihuahua turns bright red as the Sinaloa Cartel starts a war to defeat the Juárez Cartel.

You can also see a larger version of the map at OpenHeatMap.

The homicide rate was calculated with population data from the CONAPO and homicide data from the SINAIS. The data used to generate the heatmap is available as a Google Spreadsheet

Unless otherwise stated, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. Privacy policy

Disclaimer: This website is not affiliated with any of the organizations or institutions to which Diego Valle-Jones belongs. All opinions are my own.

Special Projects:

Blogs I like: