Diego Valle-Jones diegovalle

View README.md

Projected topojson example of a choropleth of Mexican municipalities and states with tooltips and each municipality colored by the number of people who live there

First download the shapefiles of Mexico (AGEBs, Manzanas, Municipios, Estados, etc) 1.4GB from

http://www.diegovalle.net/projects.html#url=%23datasets

Then convert the files 'shps/national/national_municipal.shp' and 'shps/national/national_estatal.shp' to topojson with

View index.html
1 2 3 4 5 6 7 8 9 10
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://d3js.org/topojson.v1.min.js' type='text/javascript'></script>
<script src='http://datamaps.github.io/scripts/datamaps.all.min.js' type='text/javascript'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js' type='text/javascript'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js' type='text/javascript'></script>
View contador_bici.R
1 2 3 4 5 6 7 8 9 10
## Datos del contador ciclista ubicado en Reforma 222. El contador
## sólo opera en dirección Centro
## Author: Diego Valle
## Web: www.diegovalle.net
 
library(ggplot2)
library(lubridate)
library(stringr)
library(mgcv)
library(rCharts)
View change-report.Rmd
1 2 3 4 5 6 7 8 9 10
Changes in homicide rates
========================================================
 
Look, another example of using the [mxmortalitydb](https://github.com/diegovalle/mxmortalitydb) package! Changes and trend in homicide rates in the most violent metro areas or big municipios (note the log scales). For comparison the homicide rate in Chicago (metro area) was 8.2
 
```{r}
library(mxmortalitydb)
library(stringr)
library(plyr)
library(ggplot2)
View mapa_digital_5.0.A.sh
1 2 3 4 5 6 7 8 9 10
#! /bin/bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
# Purpose: Download the shapefiles contained in the Marco geoestadístico 2010 versión 5.0.A
# comunicaciones y transportes
# cultura
# curvas de nivel
# hidrografia
View download-mapa-digital.sh
1 2 3 4 5 6 7 8 9 10
#! /bin/bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
 
# Purpose: Download the shapefiles contained in the Mapa Digital de México
 
# comunicaciones y transportes
# cultura
# curvas de nivel
# hidrografia
View download-census-shp.sh
1 2 3 4 5 6 7 8 9 10
#! /bin/bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
# Purpose: Download shapefiles of manzanas (blocks), agebs (census areas), ejes
# viales (streets), interesting areas and a whole bunch of other stuff
 
# Note that you'll need a recent version of innoextract
# http://constexpr.org/innoextract/, one that can work with files
# created by version 5.5 of Inno Setup, the one in Ubuntu universe is
# not recent enough. The version available at
View README.md

2d kde of homicide locations in the Monterrey metro area with a quartic kernel for the year of 2011

Data from El Norte

View README.md

How to create the topojson map:

curl -o estados.zip http://mapserver.inegi.org.mx/MGN/mge2010v5_0.zip
curl -o  municipios.zip http://mapserver.inegi.org.mx/MGN/mgm2010v5_0.zip
unzip estados.zip 
unzip municipios.zip
ogr2ogr states.shp Entidades_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
ogr2ogr municipalities.shp Municipios_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
topojson -o mx_tj.json -s 1e-7 -q 1e5 states.shp municipalities.shp -p state_code=+CVE_ENT,state_name=NOM_ENT,mun_code=+CVE_MUN,mun_name=NOM_MUN
Something went wrong with that request. Please try again.