Skip to content

Instantly share code, notes, and snippets.

@TiagoDevezas
Last active June 11, 2019 17:21
Show Gist options
  • Save TiagoDevezas/11d1f0e1d0fa7c15a4dc to your computer and use it in GitHub Desktop.
Save TiagoDevezas/11d1f0e1d0fa7c15a4dc to your computer and use it in GitHub Desktop.
PT Choropleth
Display the source blob
Display the rendered blob
Raw
Loading
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":{"continente":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","properties":{"name":"Setúbal"},"id":"PO19","arcs":[[[0]],[[1,2,3,4,5]]]},{"type":"Polygon","properties":{"name":"Aveiro"},"id":"PO02","arcs":[[6,7,8,9]]},{"type":"MultiPolygon","properties":{"name":"Leiria"},"id":"PO13","arcs":[[[10]],[[11,12,13,14,15]]]},{"type":"Polygon","properties":{"name":"Viana do Castelo"},"id":"PO20","arcs":[[16,17]]},{"type":"Polygon","properties":{"name":"Beja"},"id":"PO03","arcs":[[18,19,20,-3,21]]},{"type":"Polygon","properties":{"name":"Évora"},"id":"PO08","arcs":[[22,-22,-2,23,24]]},{"type":"MultiPolygon","properties":{"name":"Faro"},"id":"PO09","arcs":[[[25]],[[26]],[[27]],[[-20,28]]]},{"type":"MultiPolygon","properties":{"name":"Lisboa"},"id":"PO14","arcs":[[[29]],[[30]],[[31]],[[-5,32,33]],[[34,35,-14]]]},{"type":"Polygon","properties":{"name":"Portalegre"},"id":"PO16","arcs":[[36,-25,37,38]]},{"type":"Polygon","properties":{"name":"Santarém"},"id":"PO18","arcs":[[39,-38,-24,-6,-34,40,-35,-13]]},{"type":"Polygon","properties":{"name":"Braga"},"id":"PO04","arcs":[[41,42,-17,43,44]]},{"type":"Polygon","properties":{"name":"Bragança"},"id":"PO05","arcs":[[45,46,47,48]]},{"type":"Polygon","properties":{"name":"Castelo Branco"},"id":"PO06","arcs":[[49,-39,-40,-12,50,51]]},{"type":"MultiPolygon","properties":{"name":"Coimbra"},"id":"PO07","arcs":[[[52]],[[53,54,-51,-16,55,-7]]]},{"type":"Polygon","properties":{"name":"Guarda"},"id":"PO11","arcs":[[56,-52,-55,57,-46]]},{"type":"Polygon","properties":{"name":"Porto"},"id":"PO17","arcs":[[58,59,-9,60,-42]]},{"type":"Polygon","properties":{"name":"Viseu"},"id":"PO22","arcs":[[-58,-54,-10,-60,61,-47]]},{"type":"Polygon","properties":{"name":"Vila Real"},"id":"PO21","arcs":[[-48,-62,-59,-45,62]]}]}},"arcs":[[[2049,2923],[-16,-17],[-27,12],[1,6],[3,7],[22,2],[17,-10]],[[2920,3472],[126,-12],[19,-6],[7,-20],[-32,-30],[3,-13],[-6,-24],[-25,-18],[-47,-29],[-254,-89],[-109,-69],[-2,-16],[3,-18],[14,-12],[8,-16],[18,-46],[89,-6],[117,-35],[88,-7],[74,-12],[18,6],[4,10],[-5,12],[-5,10],[11,7],[29,-2],[21,-7],[10,-10],[17,-9],[28,-10],[37,-7],[87,2],[43,7],[70,23],[56,6],[26,-6],[59,-36],[40,-21],[14,-11],[1,-1],[1,-2],[2,-6],[3,-11],[40,-53],[-1,-12],[-12,-6],[0,-11],[14,-11],[44,-9],[22,-9],[15,-15],[-11,-34],[-49,-44],[0,-14],[19,-5],[66,-13],[41,-17],[63,-18],[27,-5],[29,-2],[27,0],[56,-11],[115,-44]],[[4083,2605],[73,-80],[23,-49],[-2,-18],[1,-13],[-14,-22],[-107,-15],[-52,-13],[-106,-13],[-24,-7],[-13,-21],[-20,-15],[-108,2],[-22,-8],[-11,-12],[-3,-16],[-20,-34],[-20,-5],[-25,4],[-22,8],[-30,7],[-21,-3],[-18,-9],[-21,-4],[-7,-8],[-2,-8],[0,-10],[-4,-10],[-15,-18],[-7,-6],[-11,-9],[-14,0],[-18,3],[-16,4],[-21,-1],[-16,-17],[-8,-14],[-9,-11],[-4,-12],[-10,-12],[2,-11],[6,-10],[14,-20],[59,-22],[45,-28],[39,-9],[34,-4],[39,-2],[40,-16],[20,-20],[29,-40],[1,-56],[-20,-85],[-33,-52],[-13,-13],[-42,-54],[-89,24],[-12,2],[-80,0],[-133,12],[-270,-26],[-53,-13],[-29,-13],[-8,-14],[-13,-14],[-52,-27],[-15,-14],[-28,-43],[-3,-15],[-5,-15],[-18,-13],[-51,-9],[-33,1],[-52,12],[-23,8],[-24,7],[-24,3],[-19,-6],[-10,-10],[-12,-8],[-17,-1],[-15,9],[-29,26],[-77,49],[-11,10],[-21,14],[-53,9],[-21,-4],[-25,-6],[-21,-7],[-22,1],[-15,5],[-18,13],[-29,14]],[[2149,1659],[13,35],[-6,64],[-17,46],[-48,49],[-101,10],[-124,39],[15,16],[21,7],[23,5],[24,12],[157,171],[56,137],[69,104],[-11,103],[-23,122],[-29,107],[-78,76],[-78,41],[-95,56],[-110,46],[-85,16],[46,24],[69,-14],[112,-49],[138,-24],[66,-18],[5,-26],[125,3],[303,-41],[152,24],[-91,3],[-79,8],[-222,53],[-26,16],[-18,27],[-5,27],[5,24],[15,18],[26,10],[0,14],[-43,8],[-29,22],[-10,27],[20,22],[-47,4],[-59,-61],[-61,-10],[0,-12],[68,-5],[31,-28],[1,-31],[-26,-15],[-72,3],[-60,8],[-107,28],[-116,21],[-148,-14],[-136,-79],[24,-9],[-172,-36],[-293,-18],[-61,-12],[-49,-19],[-56,-6],[-78,12],[-13,0],[-10,11],[0,14],[9,12],[11,5],[22,17],[91,45],[18,61],[1,91],[-74,89],[-92,73],[-43,58],[55,15],[142,9],[129,6],[63,-20],[31,-23],[19,0],[-19,40],[45,12],[96,13],[45,2],[0,12],[45,27],[49,25],[86,33],[109,47],[12,4],[17,7],[14,3]],[[1722,3488],[33,5],[26,-1]],[[1781,3492],[-4,-24],[15,-29],[25,-14],[30,-4],[35,1],[61,13],[32,9],[51,7],[34,-3],[23,-5],[28,-19],[86,-16],[20,0],[51,8],[46,30],[8,15],[36,53],[88,87],[20,4],[23,-6],[18,-8],[35,-11],[84,-15],[57,17],[52,12],[15,-5],[1,-9],[-5,-15],[-1,-14],[-4,-14],[-1,-17],[4,-17],[35,-21],[34,-4],[28,0],[79,-6]],[[3514,6565],[-27,-14],[2,-16],[-37,-23],[-65,2],[-21,-3],[-26,-15],[-17,-15],[-69,-43],[-14,-18],[-27,-13],[-23,-8],[-176,9],[-21,12],[-4,12],[0,17],[9,20],[24,30],[17,12],[16,8],[9,3],[13,6],[6,5],[15,29],[4,12],[-5,13],[-35,32],[-16,39],[-35,-2],[-47,-10],[-50,-16],[-26,-6],[-26,4],[-21,13],[-10,35],[-2,19],[18,47],[-116,39],[-65,-49],[-11,-32],[-24,-20],[-101,6],[-334,166],[-6,4]],[[2190,6856],[9,27],[58,88],[38,112],[8,6],[18,6],[2,-41],[-2,-13],[60,49],[44,18],[42,-13],[19,0],[0,12],[-7,5],[-12,11],[-8,12],[8,11],[30,9],[17,-6],[12,-10],[14,-6],[30,6],[26,14],[36,33],[-48,14],[-26,23],[8,21],[56,9],[70,3],[54,10],[47,16],[48,22],[-51,-1],[-76,-19],[-65,-7],[-11,-3],[-17,0],[-70,15],[-22,15],[-24,53],[115,79],[-29,41],[-5,-32],[-19,-26],[-22,-7],[-16,25],[-42,-39],[-33,-50],[-21,-54],[-7,-48],[-13,-31],[-33,-45],[-40,-41],[-38,-22],[290,657],[-1,44]],[[2591,7808],[1,0],[29,3],[132,9],[49,-15],[97,16],[46,16],[37,1],[27,-8],[25,-12],[43,-11],[31,2],[23,7],[20,27],[13,11],[54,28],[61,-31],[15,-11],[22,-21],[54,-21],[25,0],[10,9],[-5,12],[-14,11],[-3,12],[3,10],[80,18],[60,-10],[146,50],[10,5],[13,21]],[[3695,7936],[184,-57],[10,-12],[10,-18],[-3,-13],[-2,-42],[227,-53],[37,0],[40,3],[21,23],[8,7],[9,5],[40,17],[21,-1],[11,-7],[2,-8],[-1,-5],[-1,-2],[-5,-10],[-96,-67],[-15,-21],[-9,-23],[4,-13],[13,-26],[15,-49],[26,-35],[-2,-23],[-15,-13],[-26,-4],[-28,2],[-25,5],[-24,8],[-25,6],[-36,-1],[-53,-13],[-37,-3],[-35,3],[-24,5],[-93,-4],[34,-60],[-4,-11],[-27,-22],[-62,-64],[-70,-38],[-71,-27],[-28,-25],[-2,-8],[1,-9],[5,-13],[14,-11],[41,-23],[18,-16],[10,-13],[3,-54],[21,-26],[15,-5],[54,-11],[51,-20],[-123,-24],[-21,-10],[-17,-14],[1,-14],[34,-42],[19,-34],[17,-13],[21,-9],[19,-12],[36,-29],[-166,-33],[-70,-25],[-5,-11],[6,-13],[30,-27],[-2,-25],[-12,-16],[-86,-65],[12,-60]],[[31,4731],[-31,-18],[11,21],[20,-3]],[[4191,5696],[-59,-57],[-30,-14],[-28,-9],[-26,-3],[-28,-6],[-26,-15],[-25,-17],[-18,-8],[-30,3],[-133,-21],[-16,-8],[-17,-12],[1,-9],[-1,-12],[-19,-8],[-23,-17],[0,-9],[16,-22]],[[3729,5452],[-127,6],[-22,5],[-3,-10],[6,-13],[9,-38],[-14,-4],[-59,4],[-67,-14],[-38,-5],[-126,-23],[-55,-9],[-3,9],[-7,12],[-5,15],[-21,46],[-6,21],[-42,80],[-47,-7],[-40,-15],[-28,-1],[-42,-7],[-147,-52],[-55,-14],[-37,-4],[-55,7],[-139,-30],[-16,-12],[-17,-17],[1,-15],[8,-34],[-1,-23],[9,-15],[21,-10],[25,-10],[23,-15],[12,-31],[-11,-17],[-23,-12],[-25,-9],[-27,-8],[-66,-25],[27,-61],[5,-36],[36,-51],[-19,-15],[-78,-50],[-25,-3],[-30,-1],[-24,6],[-22,0],[-14,-9],[-2,-13],[4,-15],[20,-21],[6,-4],[0,-4],[-5,-6],[-6,-15],[-44,-15],[-146,8],[-199,-8],[-89,-17],[-41,-21],[-95,-99],[-28,-19],[-26,-9],[-59,-7],[-66,-56],[-12,-23],[18,-34],[8,-63]],[[1566,4497],[-85,10],[-57,13],[-44,3],[-34,-2],[-21,-4],[-30,-11],[-64,-37],[-71,-61],[-60,-35],[-64,-26],[-49,23],[-69,117],[-25,22],[-22,15],[-22,6],[-15,-2],[-40,4],[-24,-9],[-128,-37],[-117,0],[-28,-2]],[[497,4484],[-19,46],[-36,38],[-109,57],[-22,19],[34,5],[136,-19],[223,73],[56,24],[62,3],[37,-22],[31,-4],[36,17],[-23,26],[-50,23],[49,39],[68,40],[25,21],[56,18],[87,28],[44,36],[31,30],[62,55],[6,34],[-6,36],[38,52],[19,73],[237,314],[274,393]],[[1843,5939],[1,0],[18,-4],[77,-17],[28,-9],[42,-10],[98,-10],[30,2],[36,13],[74,16],[155,-8],[60,-2],[63,-8],[36,-11],[52,-23],[28,-20],[8,-4],[21,-3],[32,1],[16,4],[9,4],[47,38],[20,8],[22,6],[23,1],[18,-1],[22,-4],[19,-11],[20,-43],[4,-18],[0,-31],[5,-15],[12,-10],[14,-7],[21,9],[56,34],[80,24],[99,41],[61,-2],[6,10],[27,-2],[22,-9],[40,-41],[30,-37],[12,-26],[-5,-16],[-17,-13],[-22,-7],[-15,-7],[21,-3],[25,0],[123,23],[106,59],[32,2],[48,-10],[26,1],[18,9],[6,17],[-13,11],[-36,17],[-10,6],[-5,14],[-2,12],[46,36],[129,56],[90,-17],[93,60],[39,-11],[19,-8],[19,-14],[11,-13],[-21,-54],[9,-33],[125,-100],[-34,-13],[-13,-8],[-14,-20],[8,-9],[5,-8],[3,-3],[-10,-24]],[[4031,9342],[-2,-1],[-11,-2],[-38,0],[-287,-74],[-73,-13],[-265,-6],[-45,-5],[-42,-8],[-23,-8],[-54,-21],[-51,-10],[-24,1],[-25,3],[-24,-3],[-16,-5],[-24,-13],[-10,-14],[-5,-15],[-6,-29],[-6,-15],[-9,-13],[-27,-12],[-15,-14],[-7,-11],[15,-21],[-54,-45],[-20,1],[-28,3],[-33,9],[-61,5],[-89,16],[-25,8],[-15,-5],[-10,-8],[-23,-10],[-26,-3],[-156,-3],[-221,-38],[-29,-2],[-59,4],[-15,1]],[[2093,8966],[-2,24],[-24,35],[-6,45],[10,22],[68,12],[186,15],[52,12],[48,17],[42,19],[-334,-48],[-70,-5],[-39,3],[-56,16],[-58,63],[0,55],[25,87],[-20,55],[12,20],[22,18],[215,86],[102,55],[36,71],[34,12],[68,17],[78,11],[62,20],[23,19],[32,41],[26,20],[52,18],[53,5],[110,2],[56,11],[104,34],[57,10],[467,36],[51,13],[78,33],[27,9],[22,2],[52,1],[56,11],[90,31],[27,-19],[28,-29],[-9,-83],[10,-31],[38,-14],[46,6],[54,11],[63,3],[58,-11],[46,-22],[24,-28],[-7,-34],[-32,-24],[-48,-19],[-88,-28],[-88,-41],[-117,-82],[-28,-35],[-5,-36],[34,-34],[109,-20],[22,-16],[5,-25],[-11,-46]],[[7243,2347],[41,-19],[46,-1],[77,8],[73,17],[38,26],[16,-3],[9,0],[78,12],[85,4],[41,-15],[9,-4],[-30,-55],[-24,-28],[-41,-65],[-56,-58],[-27,-58],[-28,-25],[-25,-46],[-77,-5],[-171,36],[-52,2],[-27,-14],[-30,-40],[-31,-22],[-23,-7],[-39,-6],[-38,-10],[-37,3],[-39,6],[-39,1],[-32,-11],[-97,-10],[-20,-11],[1,-16],[10,-18],[1,-20],[-16,-34],[-66,-90],[-34,-65],[-83,-75],[-278,-118],[-54,-40],[-40,-58],[-27,-93],[-16,-29],[-21,-15],[-80,-43],[-28,-10],[8,-12],[-3,-9],[-6,-9],[-4,-10],[-32,-18],[-10,-8],[2,-20],[5,-3],[12,1],[15,-27],[3,-13],[6,-11],[3,-2]],[[6041,1084],[-1,0],[-74,-7],[-88,0],[-62,-18],[-60,-28],[-33,-12],[-26,-3],[-20,4],[-42,5],[-18,4],[-159,1],[-237,-50],[-53,-19],[-21,-7],[-17,-6],[-19,-1],[-55,-15],[-24,-3],[-19,-5],[-4,-13],[-46,-3],[-52,-17],[-7,-12],[-15,-12],[-40,-12],[-83,-8],[-41,0],[-99,-8],[-40,-14],[-12,-13],[-5,-13],[8,-7],[24,-16],[0,-9],[-22,-4],[-105,-29],[-69,-28],[-46,-10],[-32,-1],[-114,7],[-60,0],[-97,13],[-211,81],[-47,12],[-37,22],[-8,11],[-8,28],[-21,22],[-76,11],[-53,-4],[-27,-8],[-31,3],[-35,-1],[-64,-8],[-117,-20],[-12,-6],[-19,-14],[-6,-14],[-16,-18],[-51,-11],[-53,-12],[-131,11],[-45,10],[-115,35],[-36,3],[-117,-10],[-25,-5],[-15,-11],[-16,-10],[-17,-7],[-29,3],[-17,8],[-80,19],[-124,2],[-23,7],[-28,14],[-26,15],[-48,21],[-47,6],[-59,19],[-36,13]],[[2130,932],[11,26],[19,51],[7,89],[-18,45],[-29,31],[-40,24],[-7,25],[41,85],[14,53],[27,49],[40,10],[86,8],[17,46],[0,8],[-29,-14],[-67,-8],[-75,-1],[-25,34],[22,98],[25,68]],[[4083,2605],[11,18],[224,-2],[68,4],[43,-4],[15,-4],[37,-19],[31,-12],[28,-4],[25,-1],[67,18],[34,-1],[27,-4],[88,-18],[68,-41],[256,-58],[153,-8],[79,-15],[193,-54],[43,-7],[199,-2],[58,-6],[67,-11],[136,-2],[33,3],[6,13],[40,33],[50,26],[87,23],[5,6],[48,13],[12,9],[31,12],[21,17],[13,18],[2,13],[5,13],[96,14],[98,26],[25,4],[20,0],[77,17],[24,1],[21,-2],[9,-8],[4,-6],[2,-9],[7,-7],[11,-9],[16,-10],[12,-13],[8,-15],[5,-14],[13,-13],[62,-31],[78,-18],[18,-10],[8,-13],[5,-14],[34,-40],[9,-13],[26,-28],[26,-13],[37,-14],[45,-1],[29,5],[19,7],[13,3]],[[6914,3470],[-135,-55],[-5,-8],[-26,-25],[-10,-14],[-21,-66],[-6,-44],[2,-19],[4,-16],[15,-12],[20,-6],[18,-6],[9,-15],[-16,-27],[-127,-92],[-54,-97],[-30,-22],[35,-26],[-3,-22],[-30,-21],[-43,-23],[41,-11],[86,-31],[320,-207],[13,-11],[19,-26],[14,-12],[20,-11],[52,-19],[16,-8],[122,-157],[29,-14]],[[2920,3472],[145,61],[134,13],[31,11],[62,32],[32,4],[34,-2],[23,3],[17,5],[14,7],[13,10],[7,12],[8,9],[19,1],[52,-11],[39,-1],[36,7],[29,0],[18,-2],[16,5],[6,9],[13,9],[19,-1],[22,-7],[81,-43],[27,-10],[94,-10],[33,-6],[18,-9],[12,-12],[4,-11],[10,-8],[18,-2],[14,3],[16,-5],[17,-24],[12,-10],[49,-13],[53,25],[16,27],[-5,17],[-19,10],[-26,6],[-24,1],[-48,27],[-19,17],[0,15],[17,32],[-16,15],[-11,6],[-37,3],[-157,35],[-21,7],[-24,10],[-7,16],[10,12],[18,11],[17,12],[12,16],[8,21],[1,31],[10,18],[15,12],[15,2],[40,1],[18,7],[27,24]],[[3977,3922],[60,27],[50,10],[22,7],[23,4],[84,2],[46,-9],[0,-10],[-8,-12],[-12,-26],[14,-26],[20,-11],[18,3],[8,11],[0,13],[6,10],[3,4],[2,2],[2,1],[35,7],[46,3],[28,-4],[15,-4],[3,-2],[67,-36],[8,-16],[2,-28],[-2,-22],[10,-4],[74,-6],[27,3],[24,7],[22,9],[17,11],[49,17],[65,6],[35,-13],[136,-93],[85,-29],[32,-2],[34,0],[26,1],[63,-1],[98,18],[29,15],[48,30],[26,-2],[46,-14],[24,-3],[30,8],[29,0],[30,-2],[68,-14],[23,3],[16,4],[13,7],[15,13],[20,15],[45,18],[43,7],[63,7],[45,10],[30,9],[11,13],[0,13],[-10,10],[-21,15],[40,15],[15,0],[9,0],[2,0],[16,-18],[121,-25],[48,-24],[19,-18],[8,-34],[6,-12],[3,-20],[65,-30],[25,-38],[6,-25],[45,-32],[-18,-29],[23,-15],[38,-37],[28,-13],[45,-13],[53,0],[14,-3],[45,8],[61,32],[66,28],[89,14],[55,2],[37,-9],[36,-12],[10,-13],[2,-27],[-4,-12],[-45,-35],[-6,-10],[-3,-18],[22,-12],[1,-1]],[[4860,31],[1,-9],[-13,1],[1,22],[15,-6],[-4,-8]],[[4996,28],[-56,-18],[-76,-10],[-84,1],[-73,13],[0,14],[156,-11],[61,12],[72,38],[7,-6],[5,-6],[9,-15],[-18,-6],[-3,-6]],[[4939,52],[-48,-7],[-19,11],[-15,2],[4,6],[16,0],[9,0],[28,4],[18,-1],[-4,-6],[-10,0],[-6,-4],[13,-2],[14,-3]],[[6041,1084],[25,-20],[23,-12],[52,-22],[17,-12],[21,-36],[18,-47],[9,-42],[-7,-22],[53,-60],[22,-153],[30,-63],[-20,-29],[15,-44],[45,-85],[9,-9],[6,-8],[9,-6],[19,-4],[0,-12],[-22,-14],[-51,19],[-65,9],[-69,1],[-65,-3],[-66,-13],[-122,-44],[-51,-9],[-176,-59],[-24,-16],[-458,-160],[-99,-46],[-44,1],[-47,10],[-64,7],[-187,1],[-51,11],[-26,-22],[-33,2],[-38,12],[-29,8],[29,-24],[10,-12],[4,-17],[-68,51],[-109,47],[-215,61],[-124,14],[-96,23],[-102,-3],[-243,-17],[-103,18],[-115,21],[-90,-21],[-132,-9],[-132,25],[-6,-3],[-161,46],[-129,12],[-141,-6],[-45,-6],[-39,-15],[-96,-52],[-185,0],[-37,-6],[-78,-25],[-39,-9],[-46,-2],[-71,-9],[-67,-31],[-59,13],[-55,-28],[-25,-10],[-31,-6],[-61,-26],[-31,-6],[-46,9],[-33,17],[-33,10],[-45,-10],[21,54],[16,27],[15,11],[117,96],[45,52],[41,46],[-28,58],[55,26],[70,37],[43,85],[-23,34],[-24,30],[49,49],[84,48],[16,47],[53,64],[25,61]],[[1383,3599],[-56,-29],[-20,4],[25,34],[31,28],[34,18],[19,8],[8,3],[18,6],[2,-12],[-21,-29],[-40,-31]],[[1540,3653],[-42,-8],[-28,15],[18,26],[23,8],[18,-8],[16,-15],[-5,-18]],[[1486,3717],[-21,-10],[4,30],[25,29],[14,-11],[-22,-38]],[[1722,3488],[0,12],[-30,25],[-36,39],[-18,39],[22,30],[-70,-3],[-32,31],[-17,47],[-28,46],[129,136],[78,60],[105,41],[61,7],[130,5],[57,13],[109,41],[1,0]],[[2183,4057],[5,-11],[-7,-7],[-18,-5],[-62,-37],[-112,-16],[10,-17],[32,-12],[-59,-44],[-15,-20],[-28,-20],[-31,-32],[-105,-141],[-45,-43],[-21,-15],[-45,-23],[-1,-24],[54,-33],[11,-8],[12,-13],[23,-44]],[[1566,4497],[36,-46],[-5,-28],[209,-31],[122,19],[24,-29],[151,-74],[-42,-19],[-48,-7],[-90,2],[-36,-5],[-44,-16],[0,-12],[14,-10],[25,-6],[20,-8],[23,-25],[14,-12],[88,-40],[19,-7],[63,-12],[19,-8],[13,-8],[13,-9],[24,-27]],[[2178,4079],[-135,-49],[-261,-14],[-40,-17],[-58,-55],[-146,-105],[-168,-166],[-93,-54],[-32,-26],[-19,-31],[7,-37],[6,-64],[12,-46],[-43,-45],[-153,-24],[-173,-15],[-196,9],[-55,-21],[-56,-34],[-117,37],[-134,28],[-74,6],[-128,-9],[-61,10],[2,39],[19,33],[-38,83],[0,42],[17,18],[36,22],[74,38],[99,156],[-8,117],[-34,72],[30,43],[12,52],[118,107],[37,52],[62,70],[13,73],[18,61],[-21,49]],[[5916,5226],[23,-27],[98,-134],[55,-24],[90,-60],[50,-24],[103,-26],[26,-17],[28,-42],[46,-19],[65,-15],[127,-16],[22,-20],[0,-41],[-16,-44],[-24,-28],[-16,-27],[2,-42],[14,-42],[23,-22],[57,-23],[150,-91],[-41,-35],[-4,-40],[23,-39],[42,-30],[75,-21],[84,-11],[71,-17],[37,-36],[-6,-20],[-33,-38],[4,-16],[31,-15],[44,-12],[46,-3],[37,6],[72,22],[80,5],[79,-11],[70,-24],[48,-23],[43,-35],[19,-37],[-21,-33],[34,-14],[5,-18],[-17,-19],[-29,-19],[-102,-99],[-67,-46],[-65,-27],[42,-38],[-16,-30],[4,-28],[-25,-7],[-37,-16],[-37,-19],[-49,-11],[-139,-16],[-29,-12],[-17,-18],[-41,-24],[-51,-21],[-45,-9],[-44,-18]],[[3977,3922],[-134,22],[-41,18],[-6,13],[-11,16],[-20,20],[-33,14],[-18,15],[-11,15],[-10,19],[-28,14],[-31,11],[-72,16],[2,31],[88,69],[40,21],[168,60],[179,82],[72,29],[33,40],[38,19],[30,5],[60,-6],[43,5],[21,10],[14,8],[12,10],[71,43],[43,33],[15,15],[9,25],[21,10],[146,49],[60,47],[-4,12],[-14,13],[-48,18],[-119,61],[64,84],[64,47],[55,25],[40,7],[57,-7],[123,-34],[42,-19],[4,-4],[16,4],[13,6],[59,35],[20,8],[65,18]],[[5164,4994],[43,24],[44,30],[49,26],[59,11],[20,14],[28,30],[37,32],[50,18],[69,-3],[51,-14],[51,-4],[68,27],[40,19],[52,17],[60,11],[30,-6],[1,0]],[[3729,5452],[17,-29],[30,-10],[41,-5],[34,-8],[19,-10],[11,-11],[3,-9],[1,-11],[-2,-9],[5,-36],[-21,-17],[0,-37],[13,-68],[27,-25],[168,-33],[76,-26],[65,-1],[106,5],[65,12],[-1,10],[-4,13],[-22,30],[-2,20],[15,25],[23,20],[35,98],[15,14],[63,6],[96,-17],[74,0],[17,-9],[9,-12],[6,-14],[1,-14],[5,-14],[3,-29],[-4,-30],[7,-16],[21,-6],[32,-4],[38,-3],[61,-11],[44,-18],[57,-17],[62,-36],[63,-49],[12,-14],[23,-34],[28,-19]],[[2183,4057],[47,24],[29,28],[-81,-30]],[[4647,8489],[-11,-20],[-5,-7],[-11,-10],[-15,-7],[-15,-5],[-22,-9],[-12,-7],[-15,-8],[-23,-9],[-23,-5],[-31,0],[-35,13],[-65,18],[-33,-4],[-96,20],[-108,39],[6,18],[-12,11],[-62,31],[-149,27],[-46,-33],[-60,-22],[-93,-21],[-22,-3],[-71,-13],[-20,0],[-41,14],[-25,4],[-124,-9],[-92,-11],[-76,5],[-21,8],[-23,6],[-38,0],[-51,-6],[-57,-16],[-24,-9],[-22,-10],[-25,-3],[-23,-4],[-170,0],[-30,-3],[-11,0],[-22,6],[-16,14],[-13,25],[-4,15],[23,15],[29,4],[17,5],[10,10],[-11,11],[-30,14],[-34,4],[-42,12],[-53,26],[-18,10],[-25,12],[-30,5],[-76,1],[-78,18],[-72,20],[-71,1]],[[2229,8677],[0,1],[-35,44],[-5,40],[-14,27],[-8,32],[-39,59],[-14,43],[-20,32],[-1,11]],[[4031,9342],[-1,-4],[260,-8],[130,18]],[[4420,9348],[8,-4],[1,-9],[-5,-12],[-17,-11],[-14,-14],[-22,-55],[-28,-24],[-26,-41],[-17,-18],[-15,-12],[-69,-38],[41,-1],[39,3],[19,4],[22,2],[23,-1],[27,-2],[22,2],[58,12],[20,0],[20,-5],[78,-24],[16,-7],[8,-11],[-13,-24],[-7,-18],[-12,-86],[62,-13],[34,-4],[30,-7],[29,-5],[116,-12],[38,-1],[91,13],[62,34],[31,-8],[16,-9],[51,-44],[-7,-22],[-121,-87],[-36,-20],[-57,-12],[-11,-6],[-15,-23],[-32,-14],[-24,3],[-14,-1],[-16,-5],[-28,-19],[-27,-45],[13,-14],[-4,-10],[-9,-14],[-44,-35],[-9,-14],[-14,-5],[-10,-2],[-7,-7],[7,-13],[1,-10],[-26,-34]],[[7817,7868],[-3,0],[-49,6],[-129,3],[-266,66],[-33,20],[-24,26],[-15,25],[4,18],[13,17],[2,14],[-29,5],[-22,3],[-20,5],[-17,8],[-14,8],[14,13],[28,41],[-31,-7],[-116,-40],[-27,-20],[-61,0],[-98,13],[-236,-9]],[[6688,8083],[-77,-3],[-101,16],[-39,16],[-90,63],[-46,16],[-45,1]],[[6290,8192],[18,25],[6,10],[12,11],[29,6],[42,3],[12,3],[-5,10],[-2,13],[2,16],[12,25],[28,18],[30,16],[6,8],[-6,12],[6,20],[54,27],[103,16],[-71,21],[-26,15],[-21,26],[-17,39],[0,95],[99,36],[27,5],[26,8],[26,16],[23,31],[35,33],[29,16],[29,6],[28,1],[27,3],[22,5],[10,11],[-5,12],[-12,13],[-16,12],[-14,13],[-11,16],[-3,25],[12,51],[97,161],[77,76],[26,12],[17,5],[16,11],[8,11],[-1,27],[-3,15],[-55,37],[-27,34],[-9,20],[-7,34],[8,39],[7,20],[-18,37],[-6,10]],[[6964,9489],[35,24],[7,31],[-20,62],[7,27],[22,11],[46,17],[53,14],[44,4],[97,-29],[92,-38],[95,-21],[108,23],[71,24],[26,-6],[43,-11],[73,-27],[85,-8],[188,7],[72,21],[19,58],[92,-8],[111,-81],[90,-13],[215,4],[103,15],[40,41],[74,-15],[41,-23],[12,-32],[-25,-83],[24,-13],[54,-4],[78,-13],[-34,-36],[-74,-157],[-13,-18],[-22,-16],[-17,-19],[9,-16],[20,-17],[14,-18],[8,-36],[15,-38],[42,-31],[85,-15],[31,4],[46,11],[41,14],[20,12],[21,8],[42,0],[245,-24],[148,-26],[135,-43],[128,-64],[42,-28],[31,-19],[-144,-102],[-79,-40],[-19,-19],[2,-15],[9,-13],[-2,-13],[-115,-89],[0,-16],[-95,-4],[-42,-8],[-39,-15],[9,-1],[2,-11],[-4,-15],[-7,-11],[-12,-2],[-37,4],[-13,-2],[-95,-74],[-97,-48],[-57,-22],[-42,-15],[-177,-37],[-27,-10],[-198,-1],[-54,-5],[-35,-19],[-107,-78],[-23,-28],[-17,-16],[-107,-44],[-39,-24],[-12,-14],[8,-48],[-25,-35],[-120,-85],[-41,-20],[-83,-4],[-186,8],[-62,-16]],[[7773,6339],[-39,-3],[-130,-41],[-54,-12],[-27,-18],[-30,-45],[-26,-22],[25,-29],[22,-65],[36,-26],[36,-6],[80,-5],[33,-6],[32,-15],[41,-32],[68,-41],[121,-107],[-52,-43],[-14,-20],[6,-21],[-12,-17],[-18,-48],[-9,-8],[-30,-10],[-8,-9],[0,-11],[11,-20],[-1,-9],[-5,-17],[-2,-32],[-11,-19],[-76,-56],[-29,-8],[-69,-15],[-24,-9],[-21,-27],[4,-20],[13,-18],[4,-16],[-11,-18],[-36,-32],[-14,-18],[-1,-18],[9,-13],[3,-14],[-35,-42],[-44,-9],[-445,-27],[-94,2],[-66,20],[-51,-8],[-121,2],[-56,-6],[-50,-11],[-41,-5],[-653,15],[4,-5]],[[4191,5696],[48,24],[8,12],[21,7],[15,3],[40,3],[34,20],[68,8],[51,0],[10,7],[5,10],[4,11],[16,2],[43,2],[17,9],[15,4],[26,3],[21,-1],[19,-4],[13,-3],[15,5],[39,29],[22,7],[24,2],[58,1],[29,9],[5,11],[-13,26],[10,16],[37,19],[71,18],[43,4],[37,0],[27,-4],[28,-5],[59,-24],[8,38],[-4,32],[15,12],[14,4],[15,-1],[5,-7],[11,-7],[21,-3],[31,2],[61,20],[26,13],[11,11],[3,10],[-2,12],[-3,13],[-14,19],[-83,29],[-51,30],[-32,13],[-15,14],[-16,24],[9,15],[66,75]],[[5232,6295],[59,13],[50,2],[37,9],[114,41],[81,17],[79,24],[66,34],[59,43],[75,-15],[102,11],[29,12],[21,13],[22,26],[6,14],[41,35],[153,71],[119,-48],[70,-11],[34,2],[97,13],[65,37],[25,2],[30,4],[53,3],[23,-1],[35,-8],[-26,-114],[-38,-51],[-23,-15],[-26,-13],[-30,-21],[-8,-15],[3,-11],[10,-6],[22,-5],[19,-2],[31,-7],[64,-7],[77,-8],[136,25],[144,0],[39,6],[22,12],[6,13],[14,16],[18,14],[33,14],[20,-3],[17,-9],[12,-13],[29,-26],[27,-12],[70,-7],[68,2],[49,7],[31,-2],[18,-2],[76,-18],[46,-16],[32,-17],[12,-7],[2,-1]],[[2036,6131],[34,-6],[95,-25],[-62,-15],[-34,1],[-41,21],[-8,10],[-13,14],[12,-3],[17,3]],[[3514,6565],[34,-7],[30,-11],[93,-13],[71,-25],[47,-20],[48,-12],[24,-11],[18,0],[8,5],[8,9],[2,9],[7,8],[14,6],[127,12],[176,-14],[229,83],[164,33],[133,46],[54,14],[72,55],[103,38],[34,19],[31,11],[62,8]],[[5103,6808],[31,-44],[20,-8],[17,-13],[4,-14],[-13,-18],[-17,-13],[-25,-6],[-26,-5],[-21,-9],[-9,-13],[21,-19],[26,-9],[52,-5],[18,-9],[-3,-17],[25,-70],[20,-15],[44,-19],[10,-10],[-8,-13],[-69,-24],[-26,-15],[-22,-20],[-15,-30],[-34,-38],[83,-23],[46,-34]],[[1843,5939],[104,150],[45,27],[35,-25],[51,-12],[121,-2],[0,14],[-49,23],[-46,17],[-52,9],[-139,9],[-51,17],[-31,28],[-6,41],[39,54],[92,90],[202,383],[32,94]],[[7817,7868],[-1,0],[-12,-36],[-33,-26],[7,-24],[29,-22],[95,-49],[43,-34],[65,-78],[25,-41],[25,-16],[45,-6],[33,-11],[15,-25],[-12,-25],[-50,-7],[-4,-49],[4,-13],[10,-20],[-3,-11],[-8,-11],[-6,-19],[0,-37],[6,-27],[39,-63],[24,-65],[6,-34],[0,-24],[-21,-32],[-70,-63],[-18,-30],[6,-33],[26,-20],[34,-17],[32,-27],[16,-33],[-8,-23],[-71,-49],[-55,-68],[17,-63],[70,-55],[102,-47],[-53,-46],[-27,-14],[-130,-47],[-19,-10],[-11,-15],[-2,-17],[-2,-15],[-9,-12],[-55,-19],[-59,-2],[-59,3],[-20,-2]],[[5103,6808],[30,14],[91,7],[31,5],[81,28],[89,14],[96,35],[127,23],[202,17],[-12,40],[71,106],[41,24],[14,48],[-52,34],[-67,21],[-30,29],[34,20],[7,11],[0,14],[-10,13],[-15,12],[-76,29],[-25,15],[-4,14],[10,13],[35,23],[33,30],[34,53],[13,8],[24,12],[35,8],[75,-3],[31,-6],[44,-17],[102,-53],[17,-7],[22,-13],[49,-1],[31,21],[69,77],[3,21],[-9,19],[-14,11],[-13,39],[37,10],[115,-13],[96,43],[26,33],[2,20],[-6,15],[-16,12],[-25,5],[-28,9],[-26,11],[-22,22],[-2,11],[9,9],[73,-2],[39,13],[-15,51],[10,36],[27,57],[77,125]],[[4647,8489],[50,-31],[-2,-17],[3,-17],[22,-16],[44,-11],[83,-30],[-13,-25],[13,-29],[50,-45],[39,-14],[14,-3],[-42,-77],[-6,-47],[-15,-45]],[[4887,8082],[-133,-41],[-369,-61],[-86,-5],[-301,11],[-100,-11],[-203,-39]],[[2591,7808],[0,26],[-36,130],[3,67],[54,27],[0,12],[-113,13],[-59,53],[-40,66],[-57,55],[15,25],[-7,22],[-16,21],[-14,24],[0,59],[-14,19],[-21,5],[-13,20],[-11,20],[-43,35],[-17,28],[0,23],[-5,56],[32,63]],[[4887,8082],[160,49],[60,4],[41,-9],[71,-34],[37,-14],[52,-7],[58,-1],[57,4],[51,9],[87,29],[45,11],[52,2],[7,0],[127,-7],[141,10],[357,64]],[[4420,9348],[6,1],[99,49],[30,23],[37,19],[43,10],[49,-4],[56,0],[28,26],[15,32],[14,22],[60,11],[8,-52],[21,-56],[96,0],[21,11],[10,13],[14,10],[32,5],[82,-2],[188,22],[85,21],[47,-6],[84,-29],[53,-12],[162,-4],[-46,-60],[2,-18],[48,-13],[54,-3],[64,5],[62,10],[46,16],[16,14],[3,13],[6,11],[22,10],[24,0],[45,-16],[30,-1],[42,-7],[39,-26],[29,-33],[12,-31],[40,16],[73,40],[41,13],[46,4],[110,-1],[54,4],[215,35],[99,30],[28,19]]],"transform":{"scale":[0.0003306335686568607,0.0005188260723965956],"translate":[-9.511952277999882,36.96588776200015]},"bbox":[-9.511952277999882,36.96588776200015,-6.205947224999932,42.15362965989371]}
<!DOCTYPE html>
<meta charset="utf-8">
<style>
div.tooltip {
position: absolute;
text-align: center;
width: 150px;
height: 25px;
padding: 2px;
font-size: 12px;
color: white;
background: black;
border: 1px;
border-radius: 8px;
pointer-events: none;
}
#legend {
padding: 1.5em 0 0 1.5em;
text-align: center;
}
.list-inline {
list-style: outside none none;
padding-left: 0;
margin: 0 auto;
width: 50%;
}
li.key {
border-top-width: 15px;
border-top-style: solid;
font-size: .75em;
width: 15%;
padding-left: 0;
padding-right: 0;
display: inline-block;
}
.container {
width: 100%;
text-align: center;
}
#map {
width: 700px;
height: 500px;
display: inline-block;
margin-top: 2em;
}
</style>
<body>
<div class="container">
<div id="legend">Artigos que mencionam o distrito</div>
<div id="map"></div>
</div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://cdn.rawgit.com/d3/d3-plugins/master/jsonp/jsonp.js"></script>
<script>
var width = parseInt(d3.select("#map").style("width")),
height = parseInt(d3.select("#map").style("height"));
var svg = d3.select("#map").append("svg")
.attr("width", width)
.attr("height", height);
apiURL = 'http://irlab.fe.up.pt/p/mediaviz/panorama/api/places';
params = '?type=national';
callback = '&callback=d3.jsonp.callback';
// d3.jsonp plugin needed to get data from the API
d3.jsonp(apiURL + params + callback, function(data) {
var maxCount = d3.max(data, function(d) { return d.count })
var color_domain = [0, maxCount/2];
var color = d3.scale.quantile()
.domain(color_domain)
.range(['rgb(255,255,204)','rgb(217,240,163)','rgb(173,221,142)','rgb(120,198,121)','rgb(49,163,84)','rgb(0,104,55)']);
var tooltip = d3.select("body").append("div")
.attr("class", "tooltip")
.style("opacity", 0);
var countByFIPS = {};
data.forEach(function(d) {
countByFIPS[d.fips] = +d.count;
});
var legend = d3.select('#legend')
.append('ul')
.attr('class', 'list-inline');
var keys = legend.selectAll('li.key')
.data(color.range());
keys.enter().append('li')
.attr('class', 'key')
.style('border-top-color', String)
.text(function(d) {
var r = color.invertExtent(d);
return '>= ' + Math.round(r[0]);
});
function showTooltip(obj) {
var data = void 0;
d3.select(obj).transition().duration(300)
.style("stroke", "black")
.style('fill', function(d) { data = d; return d3.rgb(color(countByFIPS[d.id])).darker(.5)});
tooltip.transition().duration(300)
.style("opacity", 1)
tooltip.text(data.properties.name + ": " + countByFIPS[data.id])
.style("left", (d3.event.pageX) + "px")
.style("top", (d3.event.pageY -30) + "px");
}
function hideTooltip(obj) {
d3.select(obj)
.transition().duration(300)
.style('stroke', 'gray')
.style("fill", function(d) {
return color(countByFIPS[d.id]);
})
// .style("opacity", 0.8);
tooltip.transition().duration(300)
.style("opacity", 0);
}
// Continental Portugal map
d3.json('continente.json', function(err, pt) {
var distritos = topojson.feature(pt, pt.objects.continente);
var projection = d3.geo.mercator()
// .center(center)
.scale(1);
var path = d3.geo.path()
.projection(projection);
// projection.center([(b[1][0]+b[0][0])/2, (b[1][1]+b[0][1])/2]);
// projection.translate([width/2, height/2]);
// projection.scale(s);
var cWidth = width / 2,
cHeight = height;
var b = path.bounds(distritos);
var s = 0.95 / Math.max(
(b[1][0] - b[0][0]) / cWidth,
(b[1][1] - b[0][1]) / cHeight
);
b = d3.geo.bounds(distritos);
var center = [(b[1][0]+b[0][0])/2, (b[1][1]+b[0][1])/2];
projection.scale(s);
projection.center(center);
projection.translate([cWidth / 2, cHeight / 2]);
var bb = d3.select('svg')
.append('g')
.attr('class', 'continente')
.attr('width', cWidth)
.attr('height', cHeight)
.attr('transform', 'translate(' + cWidth + ',' + 0 + ')');
var distritos = bb.selectAll('g')
.data(distritos.features)
.enter()
.append('g')
.attr('class', function (d) { return d.properties.name})
.append('path')
.attr('d', path)
.style("fill", function(d) {
return color(countByFIPS[d.id]);
})
.style("stroke", "gray")
.on("mouseover", function() { showTooltip(this) })
.on("mouseout", function() { hideTooltip(this) })
});
// Madeira map
d3.json('madeira.json', function(err, madeira) {
var madeira = topojson.feature(madeira, madeira.objects.madeira);
var mWidth = width / 2,
mHeight = (height / 2) - 10;
var projection = d3.geo.mercator()
.center([-17.00479,32.74598])
.scale(7000)
.translate([mWidth / 2, mHeight / 2]);
var path = d3.geo.path()
.projection(projection);
// var b = path.bounds(madeira);
// var s = 0.95 / Math.max(
// (b[1][0] - b[0][0]) / 200,
// (b[1][1] - b[0][1]) / 100
// );
// b = d3.geo.bounds(madeira);
// var center = [(b[1][0]+b[0][0])/2, (b[1][1]+b[0][1])/2];
// projection.scale(s);
// projection.center(center);
// projection.translate([200 / 2, 100 / 2]);
var madeira_box = svg.append('g')
.attr('width', mWidth)
.attr('height', mHeight)
.attr('class', 'madeira-bb')
.attr('transform', 'translate(' + 0 + ',' + (mHeight + 10) + ')');
var madeira_bg = madeira_box.append('rect')
.attr('class', 'madeira-bg')
.style('fill', 'lightblue')
.style('stroke', 'gray')
.attr('width', mWidth)
.attr('height', mHeight);
var madeiraPath = madeira_box.selectAll('g')
.data(madeira.features)
.enter()
.append('g')
.attr('class', function (d) { return d.properties.name})
.append('path')
.attr('d', path)
.style('stroke', 'gray')
.style("fill", function(d) {
return color(countByFIPS[d.id]);
})
.on("mouseover", function() { showTooltip(this) })
.on("mouseout", function() { hideTooltip(this) })
});
// Azores map
d3.json('acores.json', function(err, acores) {
var acores = topojson.feature(acores, acores.objects.acores);
var aWidth = width / 2,
aHeight = (height / 2) - 10;
var projection = d3.geo.mercator()
.center([-25.455322, 37.768254])
.scale(3000)
.translate([aWidth / 2, aHeight / 2]);
var path = d3.geo.path()
.projection(projection);
// var b = path.bounds(madeira);
// var s = 0.95 / Math.max(
// (b[1][0] - b[0][0]) / 200,
// (b[1][1] - b[0][1]) / 100
// );
// b = d3.geo.bounds(madeira);
// var center = [(b[1][0]+b[0][0])/2, (b[1][1]+b[0][1])/2];
// projection.scale(s);
// projection.center(center);
// projection.translate([200 / 2, 100 / 2]);
var acores_box = svg.append('g')
.attr('width', aWidth)
.attr('height', aHeight)
.attr('class', 'acores-bb')
.attr('transform', 'translate(' + 0 + ',' + 0 + ')');
var acores_bg = acores_box.append('rect')
.attr('class', 'acores-bg')
.style('fill', 'lightblue')
.style('stroke', 'gray')
.attr('width', aWidth)
.attr('height', aHeight);
var acoresPath = acores_box.selectAll('g')
.data(acores.features)
.enter()
.append('g')
.attr('class', function (d) { return d.properties.name})
.append('path')
.attr('d', path)
.style('stroke', 'gray')
.style("fill", function(d) {
return color(countByFIPS[d.id]);
})
.on("mouseover", function() { showTooltip(this) })
.on("mouseout", function() { hideTooltip(this) })
});
});
</script>
</body>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@antoniojps
Copy link

Andava a procura destes ficheiros topojson. Obrigado!

@TiagoDevezas
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment