Skip to content

Instantly share code, notes, and snippets.

@poezn
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poezn/48da59e57bc09314c534 to your computer and use it in GitHub Desktop.
Save poezn/48da59e57bc09314c534 to your computer and use it in GitHub Desktop.
Aligning topojson?
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{"type":"Topology","objects":{"ca":{"type":"GeometryCollection","bbox":[-124.41118621826172,32.530426025390625,-114.12948608398438,42.00982666015625],"geometries":[{"type":"Polygon","arcs":[[0]]}]}},"arcs":[[[193,9988],[82,-2],[136,-1],[282,0],[40,-1],[32,4],[160,0],[122,-1],[121,6],[70,5],[83,-6],[460,3],[56,2],[167,2],[193,-1],[114,-3],[223,-4],[125,-1],[67,-2],[131,-1],[159,0],[17,-1],[181,0],[102,-4],[399,1],[310,0],[79,1],[186,0],[0,-201],[1,-97],[0,-456],[-1,-44],[0,-323],[2,-191],[1,-243],[1,-70],[0,-222],[-1,-14],[0,-195],[-3,-123],[0,-127],[-2,-60],[-1,-123],[0,-215],[-2,-92],[1,-189],[3,-174],[242,-180],[47,-37],[150,-111],[98,-74],[204,-156],[95,-71],[181,-140],[121,-92],[214,-166],[179,-138],[31,-25],[205,-160],[421,-334],[107,-84],[377,-304],[397,-323],[184,-151],[141,-117],[209,-173],[162,-136],[65,-55],[108,-90],[255,-217],[39,-31],[110,-94],[369,-314],[81,-71],[292,-253],[138,-123],[-2,-34],[5,-29],[-7,-57],[9,-21],[32,-21],[13,-17],[9,-31],[11,-22],[45,-43],[20,-8],[21,-18],[20,-46],[-6,-9],[13,-13],[6,-25],[15,-18],[-13,-11],[28,-25],[23,-37],[6,-28],[-7,-58],[11,-8],[24,5],[48,-30],[15,-21],[16,-2],[43,-40],[41,-13],[41,-50],[4,-47],[-18,1],[-53,-48],[-14,-10],[-3,-13],[-28,-20],[-28,-2],[-40,-38],[-28,-3],[-13,-15],[-49,-15],[-17,-23],[-4,-18],[3,-40],[-16,-18],[-14,-7],[0,-13],[-33,-33],[-19,-5],[-15,-27],[26,-28],[-16,-4],[22,-32],[-6,-10],[-20,-2],[9,-36],[-7,-13],[19,-47],[4,-16],[-7,-17],[14,-21],[0,-22],[-29,-13],[-5,-13],[16,-14],[-14,-6],[5,-13],[-5,-20],[5,-12],[-16,-20],[0,-13],[14,-25],[-34,-28],[-2,-13],[-21,-13],[-34,-45],[-6,-30],[-10,-13],[-19,-10],[-24,7],[-44,-15],[17,-25],[8,-40],[-30,-46],[8,-13],[38,-12],[10,-20],[-15,-13],[14,-22],[-4,-71],[-24,-41],[-1,-35],[9,0],[21,-30],[-1,-15],[10,-11],[13,15],[34,-20],[25,-2],[15,12],[42,-5],[19,-8],[10,-20],[11,-38],[16,6],[5,-26],[-11,-27],[15,-13],[-3,-71],[-43,-33],[-20,-28],[4,-32],[-10,-8],[-25,0],[-18,-17],[-32,-1],[0,-5],[-65,8],[-22,7],[-15,-27],[-338,-25],[-607,-48],[-204,-18],[-235,-18],[-732,-66],[-135,-15],[-91,-7],[-8,32],[1,28],[-6,36],[-28,48],[-31,20],[-23,-5],[1,25],[25,8],[27,-18],[7,-26],[26,-43],[8,-27],[13,-8],[16,15],[-2,13],[-15,10],[0,13],[-16,40],[-19,8],[-25,20],[-5,17],[-25,1],[-21,-10],[-11,-23],[2,-28],[-7,-5],[-10,36],[-2,27],[5,30],[43,18],[-1,26],[-13,2],[-15,-18],[-13,8],[9,-20],[-11,-10],[-4,43],[-22,22],[-2,18],[19,13],[12,22],[-8,61],[-11,31],[-5,37],[-34,89],[-31,70],[-130,170],[-38,38],[-37,27],[-41,21],[-26,37],[-34,28],[-26,15],[-31,1],[-10,20],[-13,10],[-41,50],[-27,15],[-35,26],[-32,13],[-13,29],[12,36],[-12,-2],[0,-21],[-18,-17],[-16,7],[-2,-12],[22,-3],[18,-10],[-41,10],[-5,12],[-71,41],[-19,15],[-64,69],[-21,7],[5,13],[-15,8],[-4,-6],[-48,8],[-26,-3],[14,-9],[-25,-8],[-7,28],[-25,-8],[4,13],[-32,-38],[6,-19],[-7,1],[-7,-20],[-61,25],[-12,13],[-33,-3],[-16,5],[-3,20],[-11,15],[34,31],[2,25],[-27,71],[-23,45],[-21,36],[-25,33],[-24,22],[-30,13],[-19,3],[-45,-5],[-62,2],[-6,-7],[-58,0],[-44,-11],[-24,-20],[-36,31],[-76,15],[-17,-1],[-31,15],[-43,13],[-25,13],[-19,3],[-36,22],[-37,1],[26,-8],[-16,0],[-31,20],[-49,38],[-5,-10],[-13,15],[-36,76],[5,15],[-21,25],[-27,5],[-29,15],[-35,31],[-18,0],[-37,38],[-15,2],[-13,16],[-21,2],[-12,12],[-21,3],[-22,10],[-23,18],[-35,5],[-37,-3],[-38,2],[-32,-24],[-18,2],[-58,23],[-44,0],[-13,-13],[-34,3],[-6,10],[-34,15],[-35,5],[-53,25],[-30,3],[-53,-5],[-44,15],[-25,-3],[-52,0],[-58,-4],[-12,5],[-48,-13],[-61,-3],[-33,-4],[-19,-7],[-12,6],[-7,26],[-20,25],[-21,33],[-37,15],[-20,13],[-43,-3],[-16,12],[-6,25],[30,74],[13,48],[-9,21],[-16,15],[-9,22],[21,64],[6,35],[-8,17],[-22,15],[-7,21],[-22,0],[9,38],[23,78],[8,53],[-2,43],[-12,38],[-10,10],[-20,3],[-23,20],[-32,8],[-19,-1],[-9,-20],[-21,16],[-63,32],[-11,3],[-40,43],[5,27],[18,35],[10,31],[2,33],[6,-5],[-2,-29],[-8,-20],[21,6],[15,15],[-15,5],[-9,30],[-9,3],[-4,33],[-20,35],[-14,11],[-45,0],[-17,12],[-32,0],[-100,96],[-24,47],[-19,15],[-16,24],[-15,10],[-13,-7],[-22,15],[-31,5],[-32,15],[-12,25],[-22,25],[-12,56],[-29,34],[-18,11],[-30,28],[-12,19],[-22,10],[-22,20],[-2,22],[-11,13],[-16,68],[-17,23],[-23,12],[-40,8],[-17,27],[-2,18],[-13,7],[-13,19],[-13,31],[-43,46],[-21,12],[-20,24],[-72,38],[-13,0],[-27,18],[-12,24],[-15,9],[-23,23],[-12,0],[4,31],[-10,22],[2,34],[-11,19],[-1,25],[-14,24],[2,13],[-16,31],[6,7],[-17,28],[14,-3],[14,8],[-7,11],[2,19],[-22,4],[-23,19],[12,8],[7,26],[9,0],[12,28],[37,-21],[8,-17],[15,1],[16,11],[30,41],[13,32],[12,65],[1,27],[11,37],[-21,51],[-46,77],[-33,37],[-15,10],[-27,8],[-41,-24],[-29,10],[-19,-14],[-43,-3],[-62,20],[-10,10],[-36,21],[-41,30],[-6,13],[-26,26],[-26,37],[-30,20],[-23,0],[-1,22],[-22,15],[-8,22],[-22,7],[-15,21],[1,15],[-10,26],[6,23],[10,76],[0,24],[-21,48],[-21,35],[-6,45],[-14,21],[-22,7],[-10,-9],[-18,27],[-4,15],[7,18],[-6,22],[7,27],[15,11],[3,51],[-12,65],[-8,68],[26,7],[6,22],[20,-7],[42,5],[12,-3],[17,-19],[12,-60],[17,-3],[-9,-13],[-19,6],[-4,-13],[7,-27],[-7,-20],[8,-15],[-9,-11],[22,-14],[-6,-22],[25,-18],[27,2],[3,-7],[27,-14],[29,1],[10,-9],[-4,-26],[9,12],[43,-10],[6,-11],[-18,-18],[24,1],[6,7],[17,-24],[26,11],[13,-15],[1,-18],[28,-26],[32,-8],[20,4],[15,14],[33,-1],[-2,8],[-44,0],[-13,6],[2,19],[-28,9],[-28,2],[-2,22],[-31,58],[-6,16],[-4,43],[-10,36],[-16,15],[-11,21],[-19,9],[-9,-12],[-22,19],[12,7],[-18,8],[14,16],[25,-2],[-37,40],[-29,10],[-47,4],[9,26],[13,8],[-8,49],[-10,29],[-12,7],[-32,-5],[-18,11],[-10,14],[-18,5],[0,10],[-16,22],[27,-11],[17,23],[13,0],[10,20],[-7,16],[34,-8],[29,9],[24,20],[17,23],[21,8],[27,-2],[29,-9],[14,-20],[18,-7],[36,17],[58,13],[19,7],[50,-10],[36,0],[40,-10],[12,2],[19,-11],[85,-17],[30,7],[39,-14],[16,0],[13,9],[-8,10],[-33,2],[22,9],[27,22],[-2,31],[14,7],[19,-9],[16,3],[19,14],[27,-10],[4,-18],[-7,-11],[-32,-6],[-20,-13],[28,-28],[24,11],[3,36],[16,4],[3,-10],[22,-4],[17,-45],[16,17],[-18,-5],[-3,22],[10,10],[27,-18],[27,15],[19,-13],[30,5],[-38,2],[-12,11],[-24,-17],[-23,16],[-21,3],[-7,12],[-15,-8],[-18,35],[7,3],[-39,12],[-24,-6],[-11,-13],[-19,9],[-21,-8],[-3,-27],[-16,-16],[-35,-18],[-17,-4],[-30,9],[-6,18],[7,7],[44,22],[28,-1],[5,21],[14,23],[11,35],[13,24],[-23,-24],[-18,-42],[-32,-27],[-56,-29],[-45,11],[-18,-1],[-20,-19],[-23,-6],[-25,4],[12,6],[7,25],[-58,-9],[-13,12],[-31,10],[25,11],[12,12],[-19,25],[-57,-7],[-14,-14],[6,-11],[-14,-17],[-36,-31],[-13,-21],[-31,0],[-23,26],[-12,-9],[-9,7],[-21,-3],[-26,28],[-21,31],[10,25],[-23,10],[9,25],[-16,9],[-19,0],[19,-14],[2,-24],[13,-15],[1,-21],[26,-32],[4,-16],[-16,-1],[-41,45],[-33,21],[-61,23],[-7,-21],[-23,-16],[-36,-3],[-21,-6],[8,-6],[4,-32],[-16,-46],[3,-11],[45,-29],[-1,-11],[-17,3],[-8,-12],[-16,-3],[-3,-11],[18,-19],[-10,-5],[-17,8],[1,-14],[21,-12],[15,-24],[18,-4],[11,-12],[-25,-15],[-23,28],[-14,-2],[-5,-16],[28,-22],[6,-22],[-5,-11],[-21,-5],[-24,5],[-6,-6],[-31,34],[-27,10],[-8,12],[-30,9],[-18,20],[-32,6],[-20,-13],[-23,10],[-7,20],[-50,27],[-16,33],[-20,17],[-43,26],[-53,10],[-19,17],[16,15],[-10,3],[-5,26],[-6,-28],[-14,3],[0,-14],[20,-17],[-36,-16],[-7,-22],[15,-5],[-55,1],[15,15],[40,94],[16,46],[0,20],[-7,20],[-9,4],[-1,20],[-12,12],[-14,29],[46,-41],[14,-16],[23,-37],[31,-35],[37,-32],[10,4],[-44,50],[-15,10],[-36,61],[-18,14],[-8,-6],[-4,21],[-16,-1],[6,18],[-10,20],[-23,29],[-25,16],[-30,-5],[-4,-8],[-16,24],[6,5],[4,28],[-20,41],[-9,0],[-7,25],[-17,13],[-12,27],[-9,1],[-23,20],[-36,21],[-45,16],[-19,23],[-28,16],[-7,9],[-26,11],[-3,17],[-14,16],[-20,10],[-6,13],[-42,58],[-14,9],[-7,20],[-21,18],[-21,8],[-9,12],[-31,14],[-8,18],[-43,36],[-15,6],[-11,15],[-39,26],[-12,25],[-22,14],[-6,11],[-37,26],[0,16],[-16,23],[12,1],[17,20],[21,49],[-2,32],[-21,60],[-6,26],[-15,7],[2,19],[-38,42],[-10,63],[-20,22],[9,24],[-16,3],[11,12],[-25,33],[8,15],[4,53],[3,16],[-8,12],[22,55],[20,40],[7,39],[-20,42],[5,10],[-2,34],[-10,47],[-11,19],[-21,12],[-10,43],[2,15],[-12,56],[-56,35],[-21,50],[-25,15],[-20,33],[-18,16],[-45,48],[-15,9],[-16,-4],[-10,12],[0,36],[-26,38],[-14,9],[-63,21],[-26,31],[-19,15],[-27,12],[-57,43],[-5,10],[-21,11],[-16,16],[1,19],[14,42],[-12,23],[-2,29],[-9,24],[-16,13],[-21,36],[27,62],[-3,16],[22,39],[35,74],[7,8],[21,-6],[12,14],[-19,5],[18,27],[-6,3],[-26,-37],[38,62],[39,57],[12,3],[-18,-20],[-18,-29],[37,-10],[14,14],[-9,18],[22,35],[-4,13],[21,37],[21,10],[32,-6],[32,19],[5,25],[-17,12],[-13,-8],[-18,13],[-15,1],[-18,-44],[-18,-15],[-8,-28],[-22,-24],[-9,2],[33,53],[36,66],[16,41],[20,66],[8,57],[-14,21],[-15,9],[-9,-8],[-6,18],[3,21],[-9,14],[4,43],[17,3],[33,89],[16,74],[18,71],[8,63],[0,48],[-16,44],[1,33],[30,-13],[0,6],[-31,11],[-18,22],[0,34],[-38,75],[-3,33],[-7,21],[-17,18],[-24,10],[-6,-4],[-56,35],[17,21],[19,51],[14,56],[0,33],[12,-2],[-3,14],[-14,9],[5,29],[-5,22]]],"transform":{"scale":[0.08677956595193355,-0.08000800080008],"translate":[46.14556002330818,800]}}
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
</style>
<body>
<svg></svg>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<script>
var cm = tributary.getCodeEditor("inlet.js")
cm.tabSize = 4;
var width = 980,
height = 800;
var path = d3.geo.path()
.projection(null);
var svg = d3.select("svg");
queue()
.defer(d3.json, "ca.json")
.defer(d3.json, "ag.json")
.await(ready);
function ready(error, ca, ag) {
svg.append("path")
.datum(topojson.feature(ca, ca.objects.ca))
.attr({
"class": "ca",
"d": path
});
svg.append("path")
.datum(topojson.feature(ag, ag.objects.agri))
.attr({
"class": "ag",
"d": path
}
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment