Maps of Mexico City

on Apr 9, 2013

Just some maps of the Mexico City metro area based on the 2010 census. You can search by address and switch to satellite view. If the maps seem slow I suggest you use chrome.

Visualising Change in Presidential Votes

on Mar 5, 2013
Click on the image to visit the interactive version (Spanish)
I liked this visualization by the New York Times of the US presidential election so much I decided to recreate it using Mexican data, and in the process added a slope graph. So go visit my new visualization of the change in presidential vote from 2006 to 2012 at the municipality level. I recommend using chrome to view the visualisation, there's also a Spanish version.


Download shapefiles of Mexico

on Feb 27, 2013
I've created a set of scripts to download and recode shapefiles from the IFE and INEGI. Once you run the scripts you'll find in the map-out directory:

  • distritos: Shapefile of the electoral distritos (districts) 
  • secciones-inegi: Shapefile of electoral secciones (precincts) with both the ife and inegi codes for the municipalities each seccion belongs to 
  • estados: Shapefile of the Mexican states according to the INEGI
  • localidades: Shapefiles of the rural localities and the polygons of the urban ones 
  • municipios: Shapefile of the municipalities of Mexico according to the INEGI
  • rdata-secciones: serialized secciones (precincts) map as an R object 

Since the IFE uses a different coding standard for the municipalities of Mexico than the INEGI, I've recoded the municipality codes so that they match the ones the INEGI uses.
Ecatepec, México according to the INEGI is 15 033, while according to the IFE it's 15 034 
Guadalajara, Jalisco according to the INEGI is 14 039, while according to the IFE it's 14 041

These codes are only available for the secciones electorales (precincts) shapefile and they are contained in the variables:

  • MUN_INEGI: The inegi municipio codes 
  • MUN_IFE: The original ife municipio codes that came with the file

The codebook for the the census data that comes with the distrito and sección shapefiles is in the FD_SECC_IFE.pdf file and the ife and inegi codes are in the ife.to.inegi.csv file

I also suggest you check out Rob Hidalgo's repository of public information (from freedom of information requests) which includes a shapefile of the municipios of Mexico according to the IFE (mine comes from the INEGI and they differ by a few municipalities)

P.S. Here's the code

Mexican Presidential Election by District

on Feb 11, 2013
Check out the interactive map I made of the results of the presidential election in Mexico. I even used hierarchical clustering to group Mexico into five clusters according to how people vote (obviously the clusters are very rough and subject to statistical error).

These are the median values for the percentage of the vote for each party in the clusters:

Interpretation Cluster PRD PAN PRI
PRI 1 0.27 0.20 0.46
PRI-PAN 2 0.23 0.34 0.38
PRI-PRD 3 0.40 0.16 0.37
PRD 4 0.54 0.15 0.27
PAN 5 0.22 0.48 0.26

Interactive map of the drug war in Mexico - 2011

on Jan 22, 2013
I've updated the interactive map I made last year to include the 2011 homicide data the INEGI recently released. Because of bad publicity the government will no longer update the drug war-related homicide database, so that dataset will forever remain stuck in September 2011.


Mapa interactivo de la guerra contra el narcotráfico - 2011

on

Bueno, pues he actualizado el mapa interactivo de la guerra contra el narcotráfico para incluir los datos de muertes por homicidio en el 2011 que acaba de publicar el INEGI. Al parecer el gobierno ya no va a actualizar los homicidios debido al crimen organizado (también llamados de presunta rivalidad delincuencial) pero el mapa los sigue mostrando.

Map of homicides in Monterrey

on Jan 15, 2013
Click on the image to visit the map

This a somewhat cleaned up 2d density map of homicides in Monterrey as reported by El Norte during all of 2012. Do take note that the map is of homicide locations rather than counts and that I removed a couple of non-homicide events that were present in the original data.