-
-
Save alx-developer/d95fe0c64ab61f5c93e45dab2789f0c4 to your computer and use it in GitHub Desktop.
Revisions
-
diegovalle revised this gist
Apr 11, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,4 @@ ogr2ogr municipalities.shp Municipios_2010_5.shp -t_srs "+proj=longlat +ellps=WG 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 ``` Related: [Projected Topojson of Mexican Municipalities](https://gist.github.com/diegovalle/10487038) -
diegovalle revised this gist
Apr 11, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,6 @@ 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 ``` Be sure to also check out this [Projected Topojson of Mexican Municipalities](https://gist.github.com/diegovalle/10487038) -
diegovalle revised this gist
Feb 12, 2014 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,5 +7,5 @@ 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 ``` -
diegovalle revised this gist
Feb 12, 2014 . 2 changed files with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ 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 states.shp municipalities.shp -p state_code=+CVE_ENT,state_name=NOM_ENT,mun_code=+CVE_MUN,mun_name=NOM_MUN ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ d3.json("mx_tj.json", function(error, mx) { svg.selectAll("path") .data(topojson.object(mx, mx.objects.municipalities).geometries) .enter().append("path") .attr("d", d3.geo.path().projection(projection)) .attr("fill", "transparent") @@ -37,12 +37,12 @@ .attr("class", "muns"); g.selectAll("path") .data(topojson.object(mx, mx.objects.states).geometries) .enter().append("path") .attr("d", d3.geo.path().projection(projection)) .attr("fill", "transparent") .style("stroke", "#333"); }); </script> -
diegovalle revised this gist
Feb 12, 2014 . 2 changed files with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ 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 estados2.shp Entidades_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0" -
diegovalle revised this gist
Feb 12, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ wget -c -nc -w 5 --random-wait --tries=10 http://mapserver.inegi.org.mx/MGN/mgm2 wget -c -nc -w 5 --random-wait --tries=10 http://mapserver.inegi.org.mx/MGN/mge2010v5_0.zip -O estados.zip unzip estados.zip unzip municipios.zip ogr2ogr estados2.shp Entidades_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0" ogr2ogr municipios2.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 estados2.shp municipios2.shp ``` -
diegovalle revised this gist
Jan 25, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ How to create the topojson map: ``` wget -c -nc -w 5 --random-wait --tries=10 http://mapserver.inegi.org.mx/MGN/mgm2010v5_0.zip -O municipios.zip wget -c -nc -w 5 --random-wait --tries=10 http://mapserver.inegi.org.mx/MGN/mge2010v5_0.zip -O estados.zip unzip estados.zip unzip municipios.zip ogr2ogr estados2.shp ESTADOS.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0" -
diegovalle revised this gist
Mar 28, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ height = 500; var projection = d3.geo.mercator() .scale(1200) .center([-102.34034978813841, 24.012062015793]); var svg = d3.select("body").append("svg") -
diegovalle renamed this gist
Mar 10, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
diegovalle revised this gist
Mar 10, 2013 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ How to create the topojson map: ``` wget -c -nc -w 5 --random-wait --tries=10 http://mapserver.inegi.org.mx/data/mgm/redirect.cfm?fileX=MUNICIPIOS50 -O municipios.zip wget -c -nc -w 5 --random-wait --tries=10 http://mapserver.inegi.org.mx/data/mgm/redirect.cfm?fileX=ESTADOS50 -O estados.zip unzip estados.zip unzip municipios.zip ogr2ogr estados2.shp ESTADOS.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0" ogr2ogr municipios2.shp MUNICIPIOS.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0" topojson -o mx_tj.json -s 1e-7 estados2.shp municipios2.shp ``` -
diegovalle created this gist
Mar 10, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ <!DOCTYPE html> <meta charset="utf-8"> <title>Mexico Topojson</title> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://d3js.org/topojson.v0.min.js"></script> <script> var x = d3.scale.linear() .domain([0, width]) .range([0, width]); var y = d3.scale.linear() .domain([0, height]) .range([height, 0]); var width = 960, height = 500; var projection = d3.geo.mercator() .scale(8500) .center([-102.34034978813841, 24.012062015793]); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); var g = svg.append("g"); d3.json("mx_tj.json", function(error, mx) { svg.selectAll("path") .data(topojson.object(mx, mx.objects.municipios2).geometries) .enter().append("path") .attr("d", d3.geo.path().projection(projection)) .attr("fill", "transparent") .style("stroke", "#333") .style("stroke-width", ".2px") .attr("class", "muns"); g.selectAll("path") .data(topojson.object(mx, mx.objects.estados2).geometries) .enter().append("path") .attr("d", d3.geo.path().projection(projection)) .attr("fill", "transparent") .style("stroke", "#333"); }); </script>