Skip to content

Instantly share code, notes, and snippets.

@ge045
Forked from eidmanna/Makefile
Last active March 27, 2016 13:57
Show Gist options
  • Select an option

  • Save ge045/6ddf4be9d4f70db25d26 to your computer and use it in GitHub Desktop.

Select an option

Save ge045/6ddf4be9d4f70db25d26 to your computer and use it in GitHub Desktop.

Revisions

  1. ge045 revised this gist Aug 9, 2014. No changes.
  2. ge045 revised this gist Aug 9, 2014. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -57,12 +57,11 @@ <h4>Passau lies in Austria</h4>
    .attr("height", height);

    d3.json("aut.json", function(error, aut) {
    console.log(aut);
    //console.log(aut);
    svg.selectAll(".subunit")
    .data(topojson.feature(aut, aut.objects.subunits).features)
    .enter().append("path")
    .attr("class", function(d) {
    console.log(d)
    return "subunit " + d.id;
    })
    .attr("d", path);
  3. ge045 revised this gist Aug 9, 2014. 4 changed files with 73 additions and 8 deletions.
    20 changes: 15 additions & 5 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,20 @@
    aut.json: subunits.json places.json
    topojson --id-property su_a3 -p name=NAME -p name -o aut.json subunits.json places.json
    topojson --id-property SU_A3 -p name=NAME -o aut.json subunits.json places.json
    underscore -i aut.json print > aut.pp.json

    subunits.json: ne_10m_admin_0_map_subunits.shp
    ogr2ogr -f GeoJSON -where "adm0_a3 IN ('AUT')" subunits.json ne_10m_admin_0_map_subunits.shp
    places.json: ne_10m_populated_places.shp
    ogr2ogr -f GeoJSON -where "iso_a2 = 'AT' AND SCALERANK < 20" places.json ne_10m_populated_places.shp
    rm subunits.json
    ogr2ogr -f GeoJSON -where "adm0_a3 IN ('AUT')" -s_srs ne_10m_admin_0_map_subunits.prj -t_srs EPSG:4326 subunits.json ne_10m_admin_0_map_subunits.shp
    touch samples.dbf

    places.json: ne_10m_populated_places.shp
    rm places.json
    ogr2ogr -f GeoJSON -where "iso_a2 = 'AT'" -s_srs ne_10m_populated_places.prj -t_srs EPSG:4326 places.json ne_10m_populated_places.shp
    touch samples.dbf

    samples.txt: samples.dbf
    python /Users/georg/work/d3js//d3_samples/d/dbfview.py -n 100000 ne_10m_populated_places.dbf > samples.places.dbf.txt
    python /Users/georg/work/d3js//d3_samples/d/dbfview.py -n 100000 ne_10m_admin_0_map_subunits.dbf > samples.sub.dbf.txt

    ne_10m_admin_0_map_subunits.shp: subunits.zip
    unzip subunits.zip
    @@ -21,4 +31,4 @@ places.zip:
    curl -o places.zip 'http://www.nacis.org/naturalearth/10m/cultural/ne_10m_populated_places.zip'

    clean:
    rm `ls | grep -v 'zip' | grep -v 'Makefile' `
    rm *.json
    2 changes: 1 addition & 1 deletion aut.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    {"type":"Topology","transform":{"scale":[0.0007627945819581924,0.00026313945274527455],"translate":[9.521154825000167,46.37864308700006]},"objects":{"subunits":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0]],"id":"AUT","properties":{"name":"Austria"}}]},"places":{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[322,4325],"properties":{"name":"Bregenz"}},{"type":"Point","coordinates":[9193,5528],"properties":{"name":"Eisenstadt"}},{"type":"Point","coordinates":[8821,5462],"properties":{"name":"Wiener Neustadt"}},{"type":"Point","coordinates":[7720,2657],"properties":{"name":"Graz"}},{"type":"Point","coordinates":[6278,919],"properties":{"name":"Klagenfurt"}},{"type":"Point","coordinates":[6250,7375],"properties":{"name":"Linz"}},{"type":"Point","coordinates":[5172,8317],"properties":{"name":"Passau"}},{"type":"Point","coordinates":[4613,5441],"properties":{"name":"Salzburg"}},{"type":"Point","coordinates":[2476,3427],"properties":{"name":"Innsbruck"}},{"type":"Point","coordinates":[8972,6929],"properties":{"name":"Vienna"}}]}},"arcs":[[[7395,9723],[100,52],[6,8],[19,42],[4,20],[3,51],[5,15],[11,0],[6,-15],[6,-19],[6,-9],[61,-1],[30,-16],[63,-61],[58,-38],[28,-31],[65,-107],[30,-22],[78,-58],[102,-110],[29,-13],[30,0],[23,13],[46,47],[12,5],[40,1],[7,-11],[5,-47],[7,-20],[9,-7],[25,-3],[14,-20],[10,-9],[11,2],[-13,-34],[16,7],[15,-1],[10,-17],[1,-40],[22,11],[7,-17],[0,-26],[2,-19],[132,-184],[69,-57],[122,14],[183,-52],[1,2],[28,8],[17,-27],[7,-5],[21,12],[14,26],[67,218],[23,29],[37,-10],[14,1],[24,19],[12,3],[12,-8],[22,-27],[78,-44],[25,-5],[25,-20],[10,-46],[5,-54],[9,-45],[18,-23],[20,-7],[50,4],[20,-14],[48,-60],[24,-17],[25,6],[51,34],[21,-3],[31,-84],[18,-251],[45,-101],[13,-178],[-7,-48],[-3,-19],[-22,-44],[-21,-34],[-10,-36],[-7,-50],[-34,-95],[-14,-52],[-5,-54],[-12,-203],[-3,-24],[-3,-11],[-3,-17],[0,-42],[4,-23],[10,-12],[26,-5],[8,-9],[14,-22],[13,-29],[6,-30],[-3,-17],[-5,-22],[-3,-19],[6,-8],[4,-8],[4,-19],[4,-22],[2,-17],[4,-22],[10,-13],[12,-10],[15,-26],[8,-5],[5,-13],[1,-17],[-2,-43],[1,-19],[20,-136],[6,-69],[1,-82],[9,-59],[33,-71],[18,-21],[21,-6],[14,-18],[19,-69],[7,-22],[17,-35],[-14,-33],[-6,-38],[-8,-71],[5,-6],[16,-25],[-7,-63],[30,-32],[42,-29],[31,-54],[-82,-134],[14,-31],[-1,-24],[-6,-23],[-4,-33],[-3,-6],[-12,-17],[-3,-10],[1,-17],[7,-8],[6,-4],[3,-7],[-5,-68],[-8,-50],[-13,-38],[-21,-33],[-46,-20],[-16,-17],[0,-41],[9,-18],[27,-24],[10,-15],[13,-71],[8,-25],[-19,-42],[2,-66],[8,-77],[3,-124],[6,-38],[11,-29],[15,-18],[-27,-25],[-95,-25],[-104,-51],[-50,18],[-19,100],[-17,-29],[-26,-80],[-14,-28],[-12,-6],[-74,23],[-14,17],[-15,30],[-10,39],[-4,40],[-8,34],[-16,23],[-105,80],[-55,13],[-48,-42],[-8,-37],[2,-50],[-7,-33],[-11,-21],[-52,-54],[-16,-27],[-9,-11],[-6,3],[-6,12],[-8,18],[-9,-19],[-20,-63],[-12,-28],[24,-27],[73,-58],[37,15],[86,-69],[43,15],[29,-26],[23,-60],[11,-77],[-8,-74],[23,-24],[18,-36],[10,-48],[-1,-59],[-14,-48],[-39,-32],[-15,-31],[6,-153],[-18,-28],[-50,-76],[-141,-127],[-15,50],[-18,24],[-16,-8],[-14,-49],[4,-145],[-3,-11],[-7,-7],[-5,-10],[-1,-23],[4,-14],[5,-7],[6,-4],[4,-8],[40,-164],[5,-63],[-9,-51],[-18,-33],[-41,-44],[4,-66],[-20,-84],[5,-62],[8,-14],[10,2],[11,-2],[9,-25],[0,-33],[-11,-65],[0,-21],[18,-23],[44,42],[22,-4],[16,-46],[-7,-44],[-30,-79],[-27,-34],[-9,-55],[10,-50],[26,-18],[16,-15],[4,-20],[-5,-21],[-15,-19],[-58,-47],[-17,-29],[38,-9],[19,-13],[18,-34],[6,-41],[-25,-12],[-34,-1],[-22,-8],[-5,-11],[-7,-3],[-6,4],[-7,10],[-23,34],[-28,7],[-53,-13],[-49,20],[-18,-5],[-13,-42],[-5,-58],[-11,-17],[-13,-6],[-13,-23],[-3,-23],[1,-21],[-1,-23],[-9,-28],[-9,-14],[-27,-23],[-34,-48],[-15,-32],[-47,-129],[-17,-32],[-21,-19],[-54,-64],[-27,-32],[-5,-2],[-54,-27],[-7,-9],[-13,-26],[1,-9],[6,-8],[1,-27],[-9,-118],[0,-12],[-2,-55],[1,-66],[15,-93],[28,-36],[15,-59],[2,-87],[-24,62],[-15,20],[-53,18],[-89,90],[-36,14],[-37,-6],[-50,-40],[-38,-31],[-35,-4],[-101,29],[-21,26],[-4,-57],[0,-49],[-7,-33],[-7,-11],[-7,-10],[-17,-9],[-20,11],[-28,-1],[-28,-15],[-20,-30],[-13,-54],[0,-7],[-4,-36],[-5,-22],[-3,-16],[-25,-38],[-39,-14],[-30,37],[-6,11],[-23,40],[-39,29],[-72,-7],[-168,-18],[-42,9],[-88,19],[-26,6],[-31,7],[-76,-49],[-48,-139],[-26,72],[-18,8],[-19,-24],[-28,-36],[-5,-1],[-23,-6],[-18,5],[-17,-14],[-21,-64],[-15,-64],[-11,-62],[-9,-58],[-14,-63],[-11,-49],[-7,-12],[-29,-27],[-33,-11],[-12,16],[-22,-19],[-8,-18],[-6,-26],[-16,-37],[-9,-47],[-10,3],[-7,3],[-6,-3],[-27,-55],[-13,-18],[-14,-7],[-28,-6],[-13,-10],[-19,-56],[-11,-73],[-6,-33],[-6,-30],[-23,-20],[-17,36],[-15,66],[-18,49],[-45,-22],[-22,7],[-18,17],[-23,21],[-7,17],[-4,22],[-6,18],[-14,6],[-45,-20],[-157,9],[-121,7],[-2,2],[-14,7],[-74,128],[-19,19],[-22,13],[-23,1],[-23,-8],[-21,-8],[-22,5],[-119,114],[-40,13],[-85,-28],[-18,0],[-87,42],[-19,3],[-21,-8],[-20,4],[-158,103],[-56,5],[-10,14],[-19,42],[-9,7],[-80,-12],[-57,20],[-134,-57],[-52,5],[-28,23],[-83,102],[-108,50],[-307,44],[-74,97],[-33,22],[-11,8],[-11,-3],[-21,-17],[-12,0],[-12,10],[-24,36],[-10,10],[-2,2],[-65,13],[-77,-20],[-19,4],[-21,20],[-41,55],[-40,14],[-31,11],[-53,44],[-46,80],[-25,122],[-11,83],[-22,28],[-27,7],[-27,21],[-13,18],[-8,15],[-3,26],[1,49],[3,44],[5,26],[4,27],[-1,47],[-12,83],[-21,29],[-55,3],[-18,14],[-8,18],[-7,24],[-15,30],[-14,15],[-31,11],[-14,11],[19,38],[0,35],[-9,36],[-8,42],[-8,88],[-6,43],[-9,38],[14,66],[80,88],[28,75],[0,52],[0,48],[-31,21],[-62,-24],[-22,-9],[-133,-137],[-93,-9],[-58,-39],[-56,-60],[-45,-71],[-59,-19],[-15,-19],[-26,-41],[-15,-7],[-24,18],[-43,63],[-25,5],[-10,-3],[-10,2],[-1,1],[-1,0],[-67,27],[-31,-6],[-39,-22],[-12,-13],[-13,-5],[-12,4],[-11,14],[-7,18],[-7,14],[-9,10],[-23,11],[-13,-6],[-12,-17],[-10,-30],[-44,-86],[-40,4],[-41,40],[-47,20],[-92,-31],[-91,-58],[-23,-28],[-85,-167],[-11,-47],[-13,-134],[-25,-117],[-1,-15],[1,-39],[-2,-19],[-6,-12],[-14,-13],[-6,-11],[-29,-100],[-18,-38],[-19,-5],[-22,15],[-46,8],[-22,-6],[-44,-29],[-13,-2],[-14,11],[-22,38],[-12,12],[-13,1],[-25,-15],[-13,1],[-38,43],[-15,10],[-27,-17],[-14,1],[-8,33],[6,19],[29,47],[6,26],[-12,39],[-101,119],[-20,11],[-23,-6],[-133,-73],[-55,12],[-42,69],[-3,81],[16,129],[-7,64],[-12,28],[-44,70],[-28,88],[-13,29],[-1,0],[-6,9],[-8,3],[-7,-3],[-38,-43],[-33,-75],[-23,-87],[-1,-71],[-32,-4],[-26,14],[-21,-8],[-20,-67],[-6,-48],[-1,-32],[-4,-29],[-13,-39],[-57,-58],[-34,-19],[-9,1],[-18,1],[-57,36],[-30,34],[-50,96],[-140,90],[-33,50],[-17,46],[-2,36],[4,41],[4,89],[5,37],[0,22],[-5,12],[-8,-2],[-6,10],[3,43],[-248,155],[-22,6],[-69,-16],[-24,12],[36,91],[9,99],[-13,97],[-31,86],[-39,46],[-1,33],[13,57],[2,27],[-12,53],[-12,33],[-6,33],[9,53],[-22,40],[-12,35],[42,141],[45,106],[5,26],[7,67],[6,34],[51,127],[12,57],[1,161],[-37,65],[-49,44],[-39,115],[-2,23],[-7,67],[3,-4],[5,-3],[77,-41],[84,2],[36,34],[19,58],[16,69],[29,65],[18,20],[20,4],[19,-13],[15,-33],[4,-44],[-2,-47],[5,-40],[26,-27],[11,2],[16,20],[7,4],[39,-29],[39,-6],[20,7],[16,25],[4,-62],[13,-36],[17,-32],[12,-51],[0,-12],[0,-11],[2,-23],[14,-17],[12,10],[12,20],[14,14],[65,-186],[11,-44],[-6,-40],[-29,-46],[14,-33],[3,-40],[2,-40],[7,-37],[12,-24],[9,1],[10,14],[17,17],[7,-2],[13,-16],[7,0],[6,8],[15,34],[58,20],[24,-25],[-1,-69],[-24,-140],[3,-25],[1,-23],[-3,-25],[-7,-13],[-17,-10],[-5,-7],[-12,-43],[-5,-24],[5,-6],[20,4],[85,21],[28,22],[59,71],[25,46],[24,62],[29,116],[8,24],[14,17],[27,19],[11,15],[22,57],[19,77],[12,86],[0,81],[-5,47],[-7,34],[-12,24],[-18,20],[13,152],[2,35],[-9,42],[-11,42],[-2,33],[19,15],[22,8],[10,8],[5,-7],[6,-36],[-2,-15],[-6,-18],[-5,-24],[2,-33],[7,-17],[11,-15],[20,-19],[56,-16],[16,5],[16,26],[27,73],[18,25],[32,-1],[173,-128],[5,-12],[4,-20],[7,-18],[11,-7],[39,10],[53,47],[18,10],[18,-2],[14,-16],[30,-44],[-11,-26],[-42,-57],[9,-30],[68,-61],[65,-139],[4,-17],[0,-26],[-3,-26],[-4,-18],[-3,0],[14,-51],[18,-22],[137,-3],[25,15],[86,117],[33,17],[28,-22],[-3,-103],[31,-8],[29,26],[19,40],[17,46],[25,46],[25,15],[57,3],[21,18],[11,38],[-5,28],[-14,18],[-16,9],[62,140],[29,13],[33,-8],[29,-19],[62,20],[28,22],[24,53],[7,35],[10,88],[9,40],[37,62],[4,11],[24,-1],[58,-23],[106,-1],[74,-29],[14,8],[13,65],[15,17],[110,44],[301,-25],[10,4],[38,94],[4,24],[2,36],[-2,101],[-4,21],[-7,9],[-10,21],[-10,25],[-4,21],[-3,31],[21,16],[32,52],[11,14],[19,16],[3,1],[-4,-17],[-3,-41],[-5,-30],[-8,-23],[-5,-26],[8,-42],[13,-23],[14,5],[29,29],[29,9],[75,-32],[23,7],[51,39],[22,-9],[6,-21],[13,-81],[8,-32],[10,-24],[39,-62],[19,-18],[27,-1],[27,11],[21,17],[12,22],[46,80],[25,25],[47,22],[47,0],[73,-37],[23,6],[-14,-67],[21,-49],[34,-44],[26,-50],[-36,-34],[-16,-88],[7,-94],[32,-51],[20,-7],[13,-9],[11,-17],[60,-130],[64,-95],[14,-12],[11,8],[11,11],[14,1],[13,-13],[7,-15],[8,-10],[14,1],[9,16],[38,87],[-1,32],[-3,23],[-4,19],[-3,21],[-1,24],[0,66],[3,10],[12,61],[2,6],[-3,-2],[-1,86],[3,-3],[21,55],[1,10],[16,75],[3,9],[3,46],[1,46],[-4,48],[-10,56],[-26,85],[-16,39],[-16,24],[-21,6],[-33,-29],[-19,-6],[-74,26],[-21,43],[24,74],[1,0],[8,27],[2,25],[1,25],[2,24],[8,30],[84,265],[-6,12],[-28,82],[-45,201],[-22,42],[-10,11],[-27,54],[-31,36],[-11,30],[-7,40],[0,6],[-4,41],[-19,84],[-93,188],[-12,38],[-12,45],[-6,50],[2,52],[8,27],[9,6],[8,-1],[8,7],[19,57],[5,12],[52,71],[18,38],[24,74],[11,25],[20,20],[73,28],[-2,9],[20,32],[43,45],[48,91],[22,29],[136,105],[180,61],[44,47],[128,217],[19,59],[7,81],[3,19],[6,20],[5,26],[3,39],[-2,108],[2,35],[6,35],[18,72],[4,37],[-3,33],[-12,37],[-6,69],[-4,17],[0,13],[7,27],[12,21],[42,31],[44,11],[136,-73],[23,-24],[21,-30],[20,-59],[54,-47],[3,-6],[12,102],[11,43],[4,-2],[27,8],[11,9],[11,21],[6,18],[22,93],[9,50],[4,55],[1,64],[-7,123],[3,45],[18,32],[-17,15],[-6,12],[-14,53],[-7,-5],[3,36],[39,158],[53,-27],[25,-26],[24,-36],[28,-45],[88,-94],[12,-24],[22,-64],[8,-31],[7,-12],[9,-7],[8,-11],[3,-23],[-2,-24],[-6,-3],[-7,2],[-4,-5],[-8,-36],[-8,-5],[-2,-11],[6,-52],[6,-21],[22,-54],[11,-19],[45,-36],[185,-40],[131,-88],[12,3],[10,7],[27,41],[68,57],[21,41],[29,150],[19,25],[32,-71],[52,-53],[15,-7],[20,8],[39,37],[21,3],[8,-14],[2,-25],[0,-25],[4,-16],[10,-2],[20,13],[9,-3],[14,-36],[8,-36],[10,-25],[21,-3],[21,40],[6,11],[6,99],[0,116],[4,103],[25,77],[69,116],[7,73],[13,44],[5,46],[8,37],[20,14],[68,-18],[68,-53],[26,4],[15,67],[-2,7],[-6,24],[-6,31],[-3,23],[3,27],[9,48],[28,238],[0,105],[-5,116],[0,108],[18,81],[-1,20],[0,18],[2,13],[4,6],[29,7],[73,-48],[102,-16],[9,-53],[6,-52],[-1,-52],[-8,-54],[26,-1]]]}
    {"type":"Topology","objects":{"subunits":{"type":"GeometryCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"geometries":[{"type":"Polygon","properties":{"name":"Austria"},"id":"AUT","arcs":[[0]]}]},"places":{"type":"GeometryCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"geometries":[{"type":"Point","properties":{"name":"Bregenz"},"coordinates":[322,4325]},{"type":"Point","properties":{"name":"Eisenstadt"},"coordinates":[9193,5528]},{"type":"Point","properties":{"name":"Wiener Neustadt"},"coordinates":[8821,5462]},{"type":"Point","properties":{"name":"Graz"},"coordinates":[7720,2657]},{"type":"Point","properties":{"name":"Klagenfurt"},"coordinates":[6278,919]},{"type":"Point","properties":{"name":"Linz"},"coordinates":[6250,7375]},{"type":"Point","properties":{"name":"Passau"},"coordinates":[5172,8317]},{"type":"Point","properties":{"name":"Salzburg"},"coordinates":[4613,5441]},{"type":"Point","properties":{"name":"Innsbruck"},"coordinates":[2476,3427]},{"type":"Point","properties":{"name":"Vienna"},"coordinates":[8972,6929]}]}},"arcs":[[[7395,9723],[100,52],[6,8],[19,42],[4,20],[3,51],[6,15],[10,0],[6,-15],[6,-19],[6,-9],[61,-1],[30,-16],[63,-61],[58,-38],[28,-31],[65,-107],[30,-22],[78,-58],[102,-110],[29,-13],[30,0],[23,13],[46,47],[12,5],[40,1],[7,-11],[5,-47],[7,-20],[9,-7],[25,-3],[14,-20],[10,-9],[11,2],[-13,-34],[16,7],[15,-1],[10,-17],[1,-40],[22,11],[7,-17],[0,-26],[2,-19],[132,-184],[69,-57],[122,14],[183,-52],[1,2],[28,8],[17,-27],[7,-5],[21,12],[14,26],[67,218],[23,29],[37,-10],[14,1],[24,19],[12,3],[12,-8],[22,-27],[78,-44],[25,-5],[25,-20],[10,-46],[5,-54],[9,-45],[18,-23],[20,-7],[50,4],[20,-14],[48,-60],[24,-17],[25,6],[51,34],[21,-3],[31,-84],[18,-251],[45,-101],[13,-178],[-7,-48],[-3,-19],[-22,-44],[-21,-34],[-10,-36],[-7,-50],[-34,-95],[-14,-52],[-5,-54],[-12,-203],[-3,-24],[-3,-11],[-3,-17],[0,-42],[4,-23],[10,-12],[26,-5],[8,-9],[14,-22],[13,-29],[6,-30],[-3,-17],[-5,-22],[-3,-19],[6,-8],[4,-8],[4,-19],[4,-22],[2,-17],[4,-22],[10,-13],[12,-10],[15,-26],[8,-5],[5,-13],[1,-17],[-2,-43],[1,-19],[20,-136],[6,-69],[1,-82],[9,-59],[33,-71],[18,-21],[21,-6],[14,-18],[19,-69],[7,-22],[17,-35],[-14,-33],[-6,-38],[-8,-71],[5,-6],[16,-25],[-7,-63],[30,-32],[42,-29],[31,-54],[-82,-134],[14,-31],[-1,-24],[-6,-23],[-4,-33],[-3,-6],[-12,-17],[-3,-10],[1,-17],[7,-8],[6,-4],[3,-7],[-5,-68],[-8,-50],[-13,-38],[-21,-33],[-46,-20],[-16,-17],[0,-41],[9,-17],[27,-25],[10,-15],[13,-71],[8,-25],[-19,-42],[2,-66],[8,-77],[3,-124],[6,-38],[11,-29],[15,-18],[-27,-25],[-95,-25],[-104,-51],[-50,18],[-19,100],[-17,-29],[-26,-80],[-14,-28],[-12,-6],[-74,23],[-14,17],[-15,30],[-10,39],[-4,40],[-8,34],[-16,23],[-105,80],[-55,13],[-48,-42],[-8,-37],[2,-50],[-7,-33],[-11,-21],[-52,-54],[-16,-27],[-9,-11],[-6,3],[-6,12],[-8,18],[-9,-19],[-20,-63],[-12,-28],[24,-27],[73,-58],[37,15],[86,-69],[43,15],[29,-26],[23,-60],[11,-77],[-8,-74],[23,-24],[18,-36],[10,-48],[-1,-59],[-14,-48],[-39,-32],[-15,-31],[6,-153],[-18,-28],[-50,-76],[-141,-127],[-15,50],[-18,24],[-16,-8],[-14,-49],[4,-145],[-3,-11],[-7,-7],[-5,-10],[-1,-23],[4,-14],[6,-7],[5,-4],[4,-8],[40,-164],[5,-63],[-9,-51],[-18,-33],[-41,-44],[4,-66],[-20,-84],[5,-62],[8,-14],[10,2],[11,-2],[9,-25],[0,-33],[-11,-65],[0,-21],[18,-23],[44,42],[22,-4],[16,-46],[-7,-44],[-30,-79],[-27,-34],[-9,-55],[10,-50],[26,-18],[16,-15],[4,-20],[-5,-21],[-15,-19],[-58,-47],[-17,-29],[38,-9],[19,-13],[18,-34],[6,-41],[-25,-12],[-34,-1],[-22,-8],[-5,-11],[-7,-3],[-6,4],[-7,10],[-23,34],[-28,7],[-53,-13],[-49,20],[-18,-5],[-13,-42],[-5,-58],[-11,-17],[-13,-6],[-13,-23],[-3,-23],[1,-21],[-1,-23],[-9,-28],[-9,-14],[-27,-23],[-34,-48],[-15,-31],[-47,-130],[-17,-32],[-21,-19],[-54,-64],[-27,-32],[-5,-2],[-54,-27],[-7,-9],[-13,-26],[1,-9],[6,-8],[1,-27],[-9,-118],[0,-12],[-2,-55],[1,-66],[15,-93],[28,-36],[15,-59],[2,-87],[-24,62],[-15,20],[-53,18],[-89,90],[-36,14],[-37,-6],[-50,-40],[-38,-31],[-35,-4],[-101,29],[-21,26],[-4,-57],[0,-49],[-7,-33],[-7,-11],[-7,-10],[-17,-9],[-20,11],[-28,-1],[-28,-15],[-20,-30],[-13,-54],[0,-7],[-4,-36],[-5,-22],[-3,-16],[-25,-38],[-39,-14],[-30,37],[-6,11],[-23,40],[-39,29],[-72,-7],[-168,-18],[-42,9],[-88,19],[-26,6],[-31,7],[-76,-49],[-48,-139],[-26,72],[-18,8],[-19,-24],[-28,-36],[-5,-1],[-23,-6],[-18,5],[-17,-14],[-21,-64],[-15,-64],[-11,-62],[-9,-58],[-14,-63],[-11,-49],[-7,-12],[-29,-27],[-33,-11],[-12,16],[-22,-19],[-8,-18],[-6,-26],[-16,-37],[-9,-47],[-10,3],[-7,3],[-6,-3],[-27,-55],[-13,-18],[-14,-7],[-28,-6],[-13,-10],[-19,-56],[-11,-73],[-6,-33],[-6,-30],[-23,-20],[-17,36],[-15,66],[-18,49],[-45,-22],[-22,7],[-18,17],[-23,21],[-7,17],[-4,22],[-6,18],[-14,6],[-45,-19],[-157,8],[-121,7],[-2,2],[-14,7],[-74,128],[-19,19],[-22,13],[-23,1],[-23,-8],[-21,-8],[-22,5],[-119,114],[-40,13],[-85,-28],[-18,0],[-87,42],[-19,3],[-21,-8],[-20,4],[-158,103],[-56,5],[-10,14],[-19,42],[-9,7],[-80,-12],[-57,20],[-134,-57],[-52,5],[-28,23],[-83,102],[-108,50],[-307,44],[-74,97],[-33,22],[-11,8],[-11,-3],[-21,-17],[-12,0],[-12,10],[-24,36],[-10,10],[-2,2],[-65,13],[-77,-20],[-19,4],[-21,20],[-41,55],[-40,14],[-31,11],[-53,44],[-46,80],[-25,122],[-11,83],[-22,28],[-27,7],[-27,21],[-13,18],[-8,15],[-3,26],[1,49],[3,44],[5,26],[4,27],[-1,47],[-12,83],[-21,29],[-55,3],[-18,14],[-8,18],[-7,24],[-15,30],[-14,15],[-31,11],[-14,11],[19,38],[0,35],[-9,36],[-8,42],[-8,88],[-6,43],[-9,38],[14,66],[80,88],[28,75],[0,52],[0,48],[-31,21],[-62,-24],[-22,-9],[-133,-137],[-93,-9],[-58,-39],[-56,-60],[-45,-71],[-59,-19],[-15,-19],[-26,-41],[-15,-7],[-24,18],[-43,63],[-25,5],[-10,-3],[-10,2],[-1,1],[-1,0],[-67,27],[-31,-6],[-39,-22],[-12,-13],[-13,-5],[-12,4],[-11,14],[-7,18],[-7,14],[-9,10],[-23,11],[-13,-6],[-12,-17],[-10,-30],[-44,-86],[-40,4],[-41,40],[-47,20],[-92,-31],[-91,-58],[-23,-28],[-85,-167],[-11,-47],[-13,-134],[-25,-117],[-1,-14],[1,-40],[-2,-19],[-6,-12],[-14,-13],[-6,-11],[-29,-100],[-18,-38],[-19,-5],[-22,15],[-46,8],[-22,-6],[-44,-29],[-13,-2],[-14,11],[-22,38],[-12,12],[-13,1],[-25,-15],[-13,1],[-38,43],[-15,10],[-27,-17],[-14,1],[-8,33],[6,19],[29,47],[6,26],[-12,39],[-101,119],[-20,11],[-23,-6],[-133,-73],[-55,12],[-42,69],[-3,81],[16,129],[-7,64],[-12,28],[-44,70],[-28,88],[-13,29],[-7,9],[-8,3],[-7,-3],[-38,-43],[-33,-75],[-23,-87],[-1,-71],[-32,-4],[-26,14],[-21,-8],[-20,-67],[-6,-48],[-1,-32],[-4,-29],[-13,-39],[-57,-58],[-34,-19],[-9,1],[-18,1],[-57,36],[-30,34],[-50,96],[-140,90],[-33,50],[-17,46],[-2,36],[4,41],[4,89],[5,37],[0,22],[-5,12],[-8,-2],[-6,10],[3,43],[-248,155],[-22,6],[-69,-16],[-24,12],[36,91],[9,99],[-13,97],[-31,86],[-39,46],[-1,33],[13,57],[2,27],[-12,53],[-12,33],[-6,33],[9,53],[-22,40],[-12,35],[42,141],[45,106],[5,26],[7,67],[6,34],[51,127],[12,57],[1,161],[-37,65],[-49,44],[-39,115],[-2,23],[-7,67],[3,-4],[5,-3],[77,-41],[84,2],[36,34],[19,58],[16,69],[29,65],[18,20],[20,4],[19,-13],[15,-32],[4,-45],[-2,-47],[5,-40],[26,-27],[11,2],[16,20],[7,4],[39,-29],[39,-6],[20,7],[16,25],[4,-62],[13,-36],[17,-32],[12,-51],[0,-12],[0,-11],[2,-23],[14,-17],[12,10],[12,20],[14,14],[65,-186],[11,-44],[-6,-40],[-29,-46],[14,-33],[3,-40],[2,-40],[7,-37],[12,-24],[9,1],[10,14],[17,17],[7,-2],[14,-16],[6,0],[6,8],[15,34],[58,20],[24,-25],[-1,-69],[-24,-140],[3,-25],[1,-23],[-3,-25],[-7,-13],[-17,-10],[-5,-7],[-12,-43],[-5,-24],[5,-6],[20,4],[85,21],[28,22],[59,71],[25,46],[24,62],[29,116],[8,24],[14,17],[27,19],[11,15],[22,57],[19,77],[12,86],[0,81],[-5,47],[-7,34],[-12,24],[-18,20],[13,152],[2,35],[-9,42],[-11,42],[-2,33],[19,15],[22,8],[10,8],[5,-7],[6,-36],[-2,-15],[-6,-18],[-5,-24],[2,-33],[7,-17],[11,-15],[20,-19],[56,-16],[16,5],[16,26],[27,73],[18,25],[32,-1],[173,-128],[5,-12],[4,-20],[7,-18],[11,-7],[39,10],[53,47],[18,10],[18,-2],[14,-16],[30,-44],[-11,-26],[-42,-57],[9,-30],[68,-61],[65,-139],[4,-17],[0,-26],[-3,-26],[-4,-18],[-3,0],[14,-51],[18,-21],[137,-4],[25,15],[86,117],[33,17],[28,-22],[-3,-103],[31,-8],[29,26],[19,40],[17,46],[25,46],[25,15],[57,3],[21,18],[11,38],[-5,28],[-14,18],[-16,9],[62,140],[29,13],[33,-8],[29,-19],[62,20],[28,22],[24,53],[7,35],[10,88],[9,40],[37,62],[4,11],[24,-1],[58,-23],[106,-1],[74,-29],[14,8],[13,65],[15,17],[110,44],[301,-25],[10,4],[38,94],[4,24],[2,36],[-2,101],[-4,21],[-7,9],[-10,21],[-10,25],[-4,21],[-3,31],[21,16],[32,52],[11,14],[19,16],[3,1],[-4,-17],[-3,-41],[-5,-30],[-8,-23],[-5,-26],[8,-42],[13,-23],[14,5],[29,29],[29,9],[75,-32],[23,7],[51,39],[22,-9],[6,-21],[13,-81],[8,-32],[10,-24],[39,-62],[19,-18],[27,-1],[27,11],[21,17],[12,22],[46,80],[25,25],[47,22],[47,0],[73,-37],[23,6],[-14,-67],[21,-49],[34,-44],[26,-50],[-36,-34],[-16,-88],[7,-94],[32,-51],[20,-7],[13,-9],[11,-17],[60,-130],[64,-95],[14,-12],[11,8],[11,11],[14,1],[13,-13],[7,-15],[8,-10],[14,1],[9,16],[38,87],[-1,32],[-3,23],[-4,19],[-3,21],[-1,24],[0,66],[3,10],[12,61],[2,6],[-3,-2],[-1,86],[3,-3],[21,55],[1,10],[16,75],[3,9],[3,46],[1,46],[-4,48],[-10,56],[-26,85],[-16,39],[-16,24],[-21,6],[-33,-29],[-19,-6],[-74,26],[-21,43],[24,74],[1,0],[8,27],[2,25],[1,25],[2,24],[8,30],[84,265],[-6,12],[-28,82],[-45,201],[-22,42],[-10,11],[-27,54],[-31,36],[-11,30],[-7,40],[0,6],[-4,41],[-19,84],[-93,188],[-12,38],[-12,45],[-6,50],[2,52],[8,27],[9,6],[8,-1],[8,7],[19,57],[5,12],[52,71],[18,38],[24,74],[11,25],[20,20],[73,28],[-2,9],[20,32],[43,45],[48,91],[22,29],[136,105],[180,61],[44,47],[128,217],[19,59],[7,81],[3,19],[6,20],[5,26],[3,40],[-2,107],[2,35],[6,35],[18,72],[4,37],[-3,33],[-12,37],[-6,69],[-4,17],[0,13],[7,27],[12,21],[42,31],[44,11],[136,-73],[23,-24],[21,-30],[20,-59],[54,-47],[3,-6],[12,102],[11,43],[4,-2],[27,8],[11,9],[11,21],[6,18],[22,93],[9,50],[4,55],[1,64],[-7,123],[3,45],[18,32],[-17,15],[-6,12],[-14,53],[-7,-5],[3,36],[39,158],[53,-27],[25,-26],[24,-36],[28,-45],[88,-94],[12,-24],[22,-64],[8,-31],[7,-12],[9,-7],[8,-11],[3,-23],[-2,-24],[-6,-3],[-7,2],[-4,-5],[-8,-36],[-8,-5],[-2,-11],[6,-52],[6,-21],[22,-54],[11,-19],[45,-36],[185,-40],[131,-88],[12,3],[10,7],[27,41],[68,57],[21,41],[29,150],[19,25],[32,-71],[52,-53],[15,-7],[20,8],[39,37],[21,3],[8,-14],[2,-25],[0,-25],[4,-16],[10,-2],[20,13],[9,-3],[14,-36],[8,-36],[10,-25],[21,-3],[21,40],[6,11],[6,99],[0,116],[4,103],[25,77],[69,116],[7,73],[13,44],[5,46],[8,37],[20,14],[68,-18],[68,-53],[26,4],[15,67],[-2,7],[-6,24],[-6,31],[-2,23],[2,27],[9,48],[28,238],[0,105],[-5,116],[0,108],[18,81],[-1,20],[0,18],[2,13],[4,6],[29,7],[73,-48],[102,-16],[9,-53],[6,-52],[-1,-52],[-8,-54],[26,-1]]],"transform":{"scale":[0.0007627945819581919,0.00026313945274527385],"translate":[9.52115482500011,46.378643087000086]}}
    49 changes: 49 additions & 0 deletions dbfview.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #import datetime
    #from mx import DateTime
    from dbfpy import dbf


    def dbfview(fname,n=1):
    try:
    db = dbf.Dbf(fname)
    print '#'*70
    print 'Sample record(s) read from {0}'.format(fname)
    print '#'*70
    for idx,rec in enumerate(db):
    if idx<(n):
    print '='*55
    print 'Record #{0}'.format(idx)
    print '='*55
    print rec
    print "Dataset contains {0} entries.".format(idx+1)
    except Exception as e:
    print "{0} failed on {1} with Exception {2}".format(__file__,fname,e)

    class nOptionError(Exception):
    def __str__():
    return "-n requires an integer argument greater zero"

    if __name__=="__main__":
    from sys import argv
    n = 1
    foundn = False
    if len(argv)<2:
    print 'No files given.'
    else:
    args = []
    for idx,arg in enumerate(argv[1:]):
    if arg == "-n":
    try:
    n = int(argv[idx+2])
    foundn = True
    except IndexError:
    raise nOptionError()
    except ValueError:
    raise nOptionError()
    elif foundn:
    foundn = False
    else:
    args.append(arg)
    for f in args:
    dbfview(f,n)

    10 changes: 8 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,11 @@

    </style>
    <body>

    <h4>Passau lies in Austria</h4>
    well, actually <a href=http://www.naturalearthdata.com/corrections/ticket.php?track=PHYUJ1VZWW>it doesn't</a>.
    <p>

    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://d3js.org/topojson.v1.min.js"></script>
    <script>
    @@ -55,8 +60,9 @@
    console.log(aut);
    svg.selectAll(".subunit")
    .data(topojson.feature(aut, aut.objects.subunits).features)
    .enter().append("path")
    .enter().append("path")
    .attr("class", function(d) {
    console.log(d)
    return "subunit " + d.id;
    })
    .attr("d", path);
    @@ -89,4 +95,4 @@
    });

    </script>
    </body>
    </body>
  4. ge045 revised this gist Aug 9, 2014. No changes.
  5. ge045 revised this gist Aug 9, 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,5 +1,5 @@
    D3 & TopoJSON sample for Austria.

    Idea and tutorial: [Let's Make a Map](http://bost.ocks.org/mike/map/) by Mike Bostock
    see [Let's Make a Map](http://bost.ocks.org/mike/map/) and [Why Use Make](http://bost.ocks.org/mike/make/)
    by [Mike Bostock](http://bl.ocks.org/mbostock)

    Makefile for build of TopoJSON 'aut.json': [Why Use Make](http://bost.ocks.org/mike/make/) by Mike Bostock
  6. @eidmanna eidmanna revised this gist Jun 1, 2013. 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,5 +1,5 @@
    D3 & TopoJSON sample for Austria.

    See Mike Bostocks blog [Let's Make a Map](http://bost.ocks.org/mike/map/)
    Idea and tutorial: [Let's Make a Map](http://bost.ocks.org/mike/map/) by Mike Bostock

    The Makefile builds the file aut.json. See Mike Bostocks blog [Why Use Make](http://bost.ocks.org/mike/make/)
    Makefile for build of TopoJSON 'aut.json': [Why Use Make](http://bost.ocks.org/mike/make/) by Mike Bostock
  7. andreas.eidmann revised this gist Jun 1, 2013. 1 changed file with 0 additions and 0 deletions.
    Binary file modified thumbnail.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  8. andreas.eidmann revised this gist Jun 1, 2013. 1 changed file with 0 additions and 0 deletions.
    Binary file added thumbnail.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  9. @eidmanna eidmanna revised this gist Jun 1, 2013. 2 changed files with 1 addition and 2 deletions.
    1 change: 0 additions & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    aut.json: subunits.json places.json
    topojson --id-property su_a3 -p name=NAME -p name -o aut.json subunits.json places.json

    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@ D3 & TopoJSON sample for Austria.

    See Mike Bostocks blog [Let's Make a Map](http://bost.ocks.org/mike/map/)

    The Makefile creates the file aut.json. See Mike Bostocks blog [Why Use Make](http://bost.ocks.org/mike/make/)
    The Makefile builds the file aut.json. See Mike Bostocks blog [Why Use Make](http://bost.ocks.org/mike/make/)
  10. @eidmanna eidmanna revised this gist Jun 1, 2013. 2 changed files with 28 additions and 1 deletion.
    25 changes: 25 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@

    aut.json: subunits.json places.json
    topojson --id-property su_a3 -p name=NAME -p name -o aut.json subunits.json places.json

    subunits.json: ne_10m_admin_0_map_subunits.shp
    ogr2ogr -f GeoJSON -where "adm0_a3 IN ('AUT')" subunits.json ne_10m_admin_0_map_subunits.shp
    places.json: ne_10m_populated_places.shp
    ogr2ogr -f GeoJSON -where "iso_a2 = 'AT' AND SCALERANK < 20" places.json ne_10m_populated_places.shp

    ne_10m_admin_0_map_subunits.shp: subunits.zip
    unzip subunits.zip
    touch ne_10m_admin_0_map_subunits.shp

    ne_10m_populated_places.shp: places.zip
    unzip places.zip
    touch ne_10m_populated_places.shp

    subunits.zip:
    curl -o subunits.zip 'http://www.nacis.org/naturalearth/10m/cultural/ne_10m_admin_0_map_subunits.zip'

    places.zip:
    curl -o places.zip 'http://www.nacis.org/naturalearth/10m/cultural/ne_10m_populated_places.zip'

    clean:
    rm `ls | grep -v 'zip' | grep -v 'Makefile' `
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    D3 & TopoJSON sample for Austria.

    See Mike Bostocks blog http://bost.ocks.org/mike/map/
    See Mike Bostocks blog [Let's Make a Map](http://bost.ocks.org/mike/map/)

    The Makefile creates the file aut.json. See Mike Bostocks blog [Why Use Make](http://bost.ocks.org/mike/make/)
  11. @eidmanna eidmanna revised this gist Jun 1, 2013. 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
    @@ -1 +1,3 @@
    Austria D3 Topojson
    D3 & TopoJSON sample for Austria.

    See Mike Bostocks blog http://bost.ocks.org/mike/map/
  12. @eidmanna eidmanna revised this gist Jun 1, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions aut.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"type":"Topology","transform":{"scale":[0.0007627945819581924,0.00026313945274527455],"translate":[9.521154825000167,46.37864308700006]},"objects":{"subunits":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0]],"id":"AUT","properties":{"name":"Austria"}}]},"places":{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[322,4325],"properties":{"name":"Bregenz"}},{"type":"Point","coordinates":[9193,5528],"properties":{"name":"Eisenstadt"}},{"type":"Point","coordinates":[8821,5462],"properties":{"name":"Wiener Neustadt"}},{"type":"Point","coordinates":[7720,2657],"properties":{"name":"Graz"}},{"type":"Point","coordinates":[6278,919],"properties":{"name":"Klagenfurt"}},{"type":"Point","coordinates":[6250,7375],"properties":{"name":"Linz"}},{"type":"Point","coordinates":[5172,8317],"properties":{"name":"Passau"}},{"type":"Point","coordinates":[4613,5441],"properties":{"name":"Salzburg"}},{"type":"Point","coordinates":[2476,3427],"properties":{"name":"Innsbruck"}},{"type":"Point","coordinates":[8972,6929],"properties":{"name":"Vienna"}}]}},"arcs":[[[7395,9723],[100,52],[6,8],[19,42],[4,20],[3,51],[5,15],[11,0],[6,-15],[6,-19],[6,-9],[61,-1],[30,-16],[63,-61],[58,-38],[28,-31],[65,-107],[30,-22],[78,-58],[102,-110],[29,-13],[30,0],[23,13],[46,47],[12,5],[40,1],[7,-11],[5,-47],[7,-20],[9,-7],[25,-3],[14,-20],[10,-9],[11,2],[-13,-34],[16,7],[15,-1],[10,-17],[1,-40],[22,11],[7,-17],[0,-26],[2,-19],[132,-184],[69,-57],[122,14],[183,-52],[1,2],[28,8],[17,-27],[7,-5],[21,12],[14,26],[67,218],[23,29],[37,-10],[14,1],[24,19],[12,3],[12,-8],[22,-27],[78,-44],[25,-5],[25,-20],[10,-46],[5,-54],[9,-45],[18,-23],[20,-7],[50,4],[20,-14],[48,-60],[24,-17],[25,6],[51,34],[21,-3],[31,-84],[18,-251],[45,-101],[13,-178],[-7,-48],[-3,-19],[-22,-44],[-21,-34],[-10,-36],[-7,-50],[-34,-95],[-14,-52],[-5,-54],[-12,-203],[-3,-24],[-3,-11],[-3,-17],[0,-42],[4,-23],[10,-12],[26,-5],[8,-9],[14,-22],[13,-29],[6,-30],[-3,-17],[-5,-22],[-3,-19],[6,-8],[4,-8],[4,-19],[4,-22],[2,-17],[4,-22],[10,-13],[12,-10],[15,-26],[8,-5],[5,-13],[1,-17],[-2,-43],[1,-19],[20,-136],[6,-69],[1,-82],[9,-59],[33,-71],[18,-21],[21,-6],[14,-18],[19,-69],[7,-22],[17,-35],[-14,-33],[-6,-38],[-8,-71],[5,-6],[16,-25],[-7,-63],[30,-32],[42,-29],[31,-54],[-82,-134],[14,-31],[-1,-24],[-6,-23],[-4,-33],[-3,-6],[-12,-17],[-3,-10],[1,-17],[7,-8],[6,-4],[3,-7],[-5,-68],[-8,-50],[-13,-38],[-21,-33],[-46,-20],[-16,-17],[0,-41],[9,-18],[27,-24],[10,-15],[13,-71],[8,-25],[-19,-42],[2,-66],[8,-77],[3,-124],[6,-38],[11,-29],[15,-18],[-27,-25],[-95,-25],[-104,-51],[-50,18],[-19,100],[-17,-29],[-26,-80],[-14,-28],[-12,-6],[-74,23],[-14,17],[-15,30],[-10,39],[-4,40],[-8,34],[-16,23],[-105,80],[-55,13],[-48,-42],[-8,-37],[2,-50],[-7,-33],[-11,-21],[-52,-54],[-16,-27],[-9,-11],[-6,3],[-6,12],[-8,18],[-9,-19],[-20,-63],[-12,-28],[24,-27],[73,-58],[37,15],[86,-69],[43,15],[29,-26],[23,-60],[11,-77],[-8,-74],[23,-24],[18,-36],[10,-48],[-1,-59],[-14,-48],[-39,-32],[-15,-31],[6,-153],[-18,-28],[-50,-76],[-141,-127],[-15,50],[-18,24],[-16,-8],[-14,-49],[4,-145],[-3,-11],[-7,-7],[-5,-10],[-1,-23],[4,-14],[5,-7],[6,-4],[4,-8],[40,-164],[5,-63],[-9,-51],[-18,-33],[-41,-44],[4,-66],[-20,-84],[5,-62],[8,-14],[10,2],[11,-2],[9,-25],[0,-33],[-11,-65],[0,-21],[18,-23],[44,42],[22,-4],[16,-46],[-7,-44],[-30,-79],[-27,-34],[-9,-55],[10,-50],[26,-18],[16,-15],[4,-20],[-5,-21],[-15,-19],[-58,-47],[-17,-29],[38,-9],[19,-13],[18,-34],[6,-41],[-25,-12],[-34,-1],[-22,-8],[-5,-11],[-7,-3],[-6,4],[-7,10],[-23,34],[-28,7],[-53,-13],[-49,20],[-18,-5],[-13,-42],[-5,-58],[-11,-17],[-13,-6],[-13,-23],[-3,-23],[1,-21],[-1,-23],[-9,-28],[-9,-14],[-27,-23],[-34,-48],[-15,-32],[-47,-129],[-17,-32],[-21,-19],[-54,-64],[-27,-32],[-5,-2],[-54,-27],[-7,-9],[-13,-26],[1,-9],[6,-8],[1,-27],[-9,-118],[0,-12],[-2,-55],[1,-66],[15,-93],[28,-36],[15,-59],[2,-87],[-24,62],[-15,20],[-53,18],[-89,90],[-36,14],[-37,-6],[-50,-40],[-38,-31],[-35,-4],[-101,29],[-21,26],[-4,-57],[0,-49],[-7,-33],[-7,-11],[-7,-10],[-17,-9],[-20,11],[-28,-1],[-28,-15],[-20,-30],[-13,-54],[0,-7],[-4,-36],[-5,-22],[-3,-16],[-25,-38],[-39,-14],[-30,37],[-6,11],[-23,40],[-39,29],[-72,-7],[-168,-18],[-42,9],[-88,19],[-26,6],[-31,7],[-76,-49],[-48,-139],[-26,72],[-18,8],[-19,-24],[-28,-36],[-5,-1],[-23,-6],[-18,5],[-17,-14],[-21,-64],[-15,-64],[-11,-62],[-9,-58],[-14,-63],[-11,-49],[-7,-12],[-29,-27],[-33,-11],[-12,16],[-22,-19],[-8,-18],[-6,-26],[-16,-37],[-9,-47],[-10,3],[-7,3],[-6,-3],[-27,-55],[-13,-18],[-14,-7],[-28,-6],[-13,-10],[-19,-56],[-11,-73],[-6,-33],[-6,-30],[-23,-20],[-17,36],[-15,66],[-18,49],[-45,-22],[-22,7],[-18,17],[-23,21],[-7,17],[-4,22],[-6,18],[-14,6],[-45,-20],[-157,9],[-121,7],[-2,2],[-14,7],[-74,128],[-19,19],[-22,13],[-23,1],[-23,-8],[-21,-8],[-22,5],[-119,114],[-40,13],[-85,-28],[-18,0],[-87,42],[-19,3],[-21,-8],[-20,4],[-158,103],[-56,5],[-10,14],[-19,42],[-9,7],[-80,-12],[-57,20],[-134,-57],[-52,5],[-28,23],[-83,102],[-108,50],[-307,44],[-74,97],[-33,22],[-11,8],[-11,-3],[-21,-17],[-12,0],[-12,10],[-24,36],[-10,10],[-2,2],[-65,13],[-77,-20],[-19,4],[-21,20],[-41,55],[-40,14],[-31,11],[-53,44],[-46,80],[-25,122],[-11,83],[-22,28],[-27,7],[-27,21],[-13,18],[-8,15],[-3,26],[1,49],[3,44],[5,26],[4,27],[-1,47],[-12,83],[-21,29],[-55,3],[-18,14],[-8,18],[-7,24],[-15,30],[-14,15],[-31,11],[-14,11],[19,38],[0,35],[-9,36],[-8,42],[-8,88],[-6,43],[-9,38],[14,66],[80,88],[28,75],[0,52],[0,48],[-31,21],[-62,-24],[-22,-9],[-133,-137],[-93,-9],[-58,-39],[-56,-60],[-45,-71],[-59,-19],[-15,-19],[-26,-41],[-15,-7],[-24,18],[-43,63],[-25,5],[-10,-3],[-10,2],[-1,1],[-1,0],[-67,27],[-31,-6],[-39,-22],[-12,-13],[-13,-5],[-12,4],[-11,14],[-7,18],[-7,14],[-9,10],[-23,11],[-13,-6],[-12,-17],[-10,-30],[-44,-86],[-40,4],[-41,40],[-47,20],[-92,-31],[-91,-58],[-23,-28],[-85,-167],[-11,-47],[-13,-134],[-25,-117],[-1,-15],[1,-39],[-2,-19],[-6,-12],[-14,-13],[-6,-11],[-29,-100],[-18,-38],[-19,-5],[-22,15],[-46,8],[-22,-6],[-44,-29],[-13,-2],[-14,11],[-22,38],[-12,12],[-13,1],[-25,-15],[-13,1],[-38,43],[-15,10],[-27,-17],[-14,1],[-8,33],[6,19],[29,47],[6,26],[-12,39],[-101,119],[-20,11],[-23,-6],[-133,-73],[-55,12],[-42,69],[-3,81],[16,129],[-7,64],[-12,28],[-44,70],[-28,88],[-13,29],[-1,0],[-6,9],[-8,3],[-7,-3],[-38,-43],[-33,-75],[-23,-87],[-1,-71],[-32,-4],[-26,14],[-21,-8],[-20,-67],[-6,-48],[-1,-32],[-4,-29],[-13,-39],[-57,-58],[-34,-19],[-9,1],[-18,1],[-57,36],[-30,34],[-50,96],[-140,90],[-33,50],[-17,46],[-2,36],[4,41],[4,89],[5,37],[0,22],[-5,12],[-8,-2],[-6,10],[3,43],[-248,155],[-22,6],[-69,-16],[-24,12],[36,91],[9,99],[-13,97],[-31,86],[-39,46],[-1,33],[13,57],[2,27],[-12,53],[-12,33],[-6,33],[9,53],[-22,40],[-12,35],[42,141],[45,106],[5,26],[7,67],[6,34],[51,127],[12,57],[1,161],[-37,65],[-49,44],[-39,115],[-2,23],[-7,67],[3,-4],[5,-3],[77,-41],[84,2],[36,34],[19,58],[16,69],[29,65],[18,20],[20,4],[19,-13],[15,-33],[4,-44],[-2,-47],[5,-40],[26,-27],[11,2],[16,20],[7,4],[39,-29],[39,-6],[20,7],[16,25],[4,-62],[13,-36],[17,-32],[12,-51],[0,-12],[0,-11],[2,-23],[14,-17],[12,10],[12,20],[14,14],[65,-186],[11,-44],[-6,-40],[-29,-46],[14,-33],[3,-40],[2,-40],[7,-37],[12,-24],[9,1],[10,14],[17,17],[7,-2],[13,-16],[7,0],[6,8],[15,34],[58,20],[24,-25],[-1,-69],[-24,-140],[3,-25],[1,-23],[-3,-25],[-7,-13],[-17,-10],[-5,-7],[-12,-43],[-5,-24],[5,-6],[20,4],[85,21],[28,22],[59,71],[25,46],[24,62],[29,116],[8,24],[14,17],[27,19],[11,15],[22,57],[19,77],[12,86],[0,81],[-5,47],[-7,34],[-12,24],[-18,20],[13,152],[2,35],[-9,42],[-11,42],[-2,33],[19,15],[22,8],[10,8],[5,-7],[6,-36],[-2,-15],[-6,-18],[-5,-24],[2,-33],[7,-17],[11,-15],[20,-19],[56,-16],[16,5],[16,26],[27,73],[18,25],[32,-1],[173,-128],[5,-12],[4,-20],[7,-18],[11,-7],[39,10],[53,47],[18,10],[18,-2],[14,-16],[30,-44],[-11,-26],[-42,-57],[9,-30],[68,-61],[65,-139],[4,-17],[0,-26],[-3,-26],[-4,-18],[-3,0],[14,-51],[18,-22],[137,-3],[25,15],[86,117],[33,17],[28,-22],[-3,-103],[31,-8],[29,26],[19,40],[17,46],[25,46],[25,15],[57,3],[21,18],[11,38],[-5,28],[-14,18],[-16,9],[62,140],[29,13],[33,-8],[29,-19],[62,20],[28,22],[24,53],[7,35],[10,88],[9,40],[37,62],[4,11],[24,-1],[58,-23],[106,-1],[74,-29],[14,8],[13,65],[15,17],[110,44],[301,-25],[10,4],[38,94],[4,24],[2,36],[-2,101],[-4,21],[-7,9],[-10,21],[-10,25],[-4,21],[-3,31],[21,16],[32,52],[11,14],[19,16],[3,1],[-4,-17],[-3,-41],[-5,-30],[-8,-23],[-5,-26],[8,-42],[13,-23],[14,5],[29,29],[29,9],[75,-32],[23,7],[51,39],[22,-9],[6,-21],[13,-81],[8,-32],[10,-24],[39,-62],[19,-18],[27,-1],[27,11],[21,17],[12,22],[46,80],[25,25],[47,22],[47,0],[73,-37],[23,6],[-14,-67],[21,-49],[34,-44],[26,-50],[-36,-34],[-16,-88],[7,-94],[32,-51],[20,-7],[13,-9],[11,-17],[60,-130],[64,-95],[14,-12],[11,8],[11,11],[14,1],[13,-13],[7,-15],[8,-10],[14,1],[9,16],[38,87],[-1,32],[-3,23],[-4,19],[-3,21],[-1,24],[0,66],[3,10],[12,61],[2,6],[-3,-2],[-1,86],[3,-3],[21,55],[1,10],[16,75],[3,9],[3,46],[1,46],[-4,48],[-10,56],[-26,85],[-16,39],[-16,24],[-21,6],[-33,-29],[-19,-6],[-74,26],[-21,43],[24,74],[1,0],[8,27],[2,25],[1,25],[2,24],[8,30],[84,265],[-6,12],[-28,82],[-45,201],[-22,42],[-10,11],[-27,54],[-31,36],[-11,30],[-7,40],[0,6],[-4,41],[-19,84],[-93,188],[-12,38],[-12,45],[-6,50],[2,52],[8,27],[9,6],[8,-1],[8,7],[19,57],[5,12],[52,71],[18,38],[24,74],[11,25],[20,20],[73,28],[-2,9],[20,32],[43,45],[48,91],[22,29],[136,105],[180,61],[44,47],[128,217],[19,59],[7,81],[3,19],[6,20],[5,26],[3,39],[-2,108],[2,35],[6,35],[18,72],[4,37],[-3,33],[-12,37],[-6,69],[-4,17],[0,13],[7,27],[12,21],[42,31],[44,11],[136,-73],[23,-24],[21,-30],[20,-59],[54,-47],[3,-6],[12,102],[11,43],[4,-2],[27,8],[11,9],[11,21],[6,18],[22,93],[9,50],[4,55],[1,64],[-7,123],[3,45],[18,32],[-17,15],[-6,12],[-14,53],[-7,-5],[3,36],[39,158],[53,-27],[25,-26],[24,-36],[28,-45],[88,-94],[12,-24],[22,-64],[8,-31],[7,-12],[9,-7],[8,-11],[3,-23],[-2,-24],[-6,-3],[-7,2],[-4,-5],[-8,-36],[-8,-5],[-2,-11],[6,-52],[6,-21],[22,-54],[11,-19],[45,-36],[185,-40],[131,-88],[12,3],[10,7],[27,41],[68,57],[21,41],[29,150],[19,25],[32,-71],[52,-53],[15,-7],[20,8],[39,37],[21,3],[8,-14],[2,-25],[0,-25],[4,-16],[10,-2],[20,13],[9,-3],[14,-36],[8,-36],[10,-25],[21,-3],[21,40],[6,11],[6,99],[0,116],[4,103],[25,77],[69,116],[7,73],[13,44],[5,46],[8,37],[20,14],[68,-18],[68,-53],[26,4],[15,67],[-2,7],[-6,24],[-6,31],[-3,23],[3,27],[9,48],[28,238],[0,105],[-5,116],[0,108],[18,81],[-1,20],[0,18],[2,13],[4,6],[29,7],[73,-48],[102,-16],[9,-53],[6,-52],[-1,-52],[-8,-54],[26,-1]]]}
  13. @eidmanna eidmanna revised this gist Jun 1, 2013. 1 changed file with 92 additions and 0 deletions.
    92 changes: 92 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    <!DOCTYPE html>
    <meta charset="utf-8">
    <style>

    .subunit.AUT { fill: #dcd; }
    .place,
    .place-label {
    fill: #444;
    }

    text {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 10px;
    pointer-events: none;
    }
    .subunit-boundary {
    fill: none;
    stroke: #777;
    stroke-dasharray: 2,2;
    stroke-linejoin: round;
    }
    .subunit-label {
    fill: #777;
    fill-opacity: .5;
    font-size: 20px;
    font-weight: 300;
    text-anchor: middle;
    }

    </style>
    <body>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://d3js.org/topojson.v1.min.js"></script>
    <script>

    var width = 960,
    height = 1160;

    var projection = d3.geo.albers()
    .center([0, 45.5])
    .rotate([-13.8, 0])
    .parallels([40, 50])
    .scale(9000)
    .translate([width / 2, height / 2]);

    var path = d3.geo.path()
    .projection(projection)
    .pointRadius(2);

    var svg = d3.select("body").append("svg")
    .attr("width", width)
    .attr("height", height);

    d3.json("aut.json", function(error, aut) {
    console.log(aut);
    svg.selectAll(".subunit")
    .data(topojson.feature(aut, aut.objects.subunits).features)
    .enter().append("path")
    .attr("class", function(d) {
    return "subunit " + d.id;
    })
    .attr("d", path);

    svg.append("path")
    .datum(topojson.feature(aut, aut.objects.places))
    .attr("d", path)
    .attr("class", "place");

    svg.selectAll(".place-label")
    .data(topojson.feature(aut, aut.objects.places).features)
    .enter().append("text")
    .attr("class", "place-label")
    .attr("transform", function(d) { return "translate(" + projection(d.geometry.coordinates) + ")"; })
    .attr("dy", ".35em")
    .text(function(d) { return d.properties.name; });

    svg.selectAll(".place-label")
    .attr("x", function(d) { return d.geometry.coordinates[0] > 16.3 ? 6 : -6; })
    .style("text-anchor", function(d) { return d.geometry.coordinates[0] > 16.3 ? "start" : "end"; });

    svg.selectAll(".subunit-label")
    .data(topojson.feature(aut, aut.objects.subunits).features)
    .enter().append("text")
    .attr("class", function(d) { return "subunit-label " + d.id; })
    .attr("transform", function(d) { return "translate(" + path.centroid(d) + ")"; })
    .attr("dy", ".35em")
    .text(function(d) { return d.properties.name; });

    });

    </script>
    </body>
  14. @eidmanna eidmanna created this gist Jun 1, 2013.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Austria D3 Topojson