Skip to content

Instantly share code, notes, and snippets.

@alx-developer
Forked from diegovalle/README.md
Created April 5, 2020 20:52
Show Gist options
  • Save alx-developer/d95fe0c64ab61f5c93e45dab2789f0c4 to your computer and use it in GitHub Desktop.
Save alx-developer/d95fe0c64ab61f5c93e45dab2789f0c4 to your computer and use it in GitHub Desktop.

Revisions

  1. @diegovalle diegovalle revised this gist Apr 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original 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
    ```

    Be sure to also check out this [Projected Topojson of Mexican Municipalities](https://gist.github.com/diegovalle/10487038)
    Related: [Projected Topojson of Mexican Municipalities](https://gist.github.com/diegovalle/10487038)
  2. @diegovalle diegovalle revised this gist Apr 11, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original 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)
  3. @diegovalle diegovalle revised this gist Feb 12, 2014. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original 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 states.shp municipalities.shp -p state_code=+CVE_ENT,state_name=NOM_ENT,mun_code=+CVE_MUN,mun_name=NOM_MUN
    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
    ```
    2 changes: 1 addition & 1 deletion mx_tj.json
    1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
  4. @diegovalle diegovalle revised this gist Feb 12, 2014. 2 changed files with 6 additions and 6 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original 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 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
    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
    ```
    6 changes: 3 additions & 3 deletions index.html
    Original 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.municipios2).geometries)
    .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.estados2).geometries)
    .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>
    </script>
  5. @diegovalle diegovalle revised this gist Feb 12, 2014. 2 changed files with 3 additions and 3 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original 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
    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"
    2 changes: 1 addition & 1 deletion mx_tj.json
    1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
  6. @diegovalle diegovalle revised this gist Feb 12, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original 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 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"
    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
    ```
  7. @diegovalle diegovalle revised this gist Jan 25, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original 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/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
    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"
  8. @diegovalle diegovalle revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@
    height = 500;

    var projection = d3.geo.mercator()
    .scale(8500)
    .scale(1200)
    .center([-102.34034978813841, 24.012062015793]);

    var svg = d3.select("body").append("svg")
  9. @diegovalle diegovalle renamed this gist Mar 10, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. @diegovalle diegovalle revised this gist Mar 10, 2013. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions readme.md
    Original 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
    ```
  11. @diegovalle diegovalle created this gist Mar 10, 2013.
    48 changes: 48 additions & 0 deletions index.html
    Original 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>
    1 change: 1 addition & 0 deletions mx_tj.json
    1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.