Coder Social home page Coder Social logo

canada-elections's Introduction

Finally, I'm open-sourcing my Canadian elections scripts! I first wrote them in 2009, months following my involvement with CBC/Radio-Canada on the television coverage of the 40th general election in Fall 2008.

The project uses geographic data in Shapefile format from GeoGratis (http://geogratis.cgdi.gc.ca/geogratis/en/option/select.do?id=258D0E88-4C19-7DB1-41C2-0D0CF1CAF49C). I used postgis utility shp2pgsql to convert them for my database.

I mainly use libkml (http://code.google.com/p/libkml/), which has since 2010 been included in Ubuntu, my platform of choice for development.

fedpolls.py is the main file to generate KML files and was rewritten in summer 2011. kmlcedric.py is a library of common functions.

I provide the data too, even if you can get it elsewhere, except for the converted Shapefiles (too big for GitHub). There are SQL dumps (schema only) that create the tables needed. I formatted the results data too, which may be time-consuming otherwise.

You must also create a new column for the geometries called "the_geom_nowater" that is created by intersecting a cartographic version of the federal electoral districts (try googling it, it's on some govt website).

kmlbig.txt are IDs of ridings that must be generated with the water, because the watershores would make the files too big. kmlnormal.txt are the rest.

My personal blog contains information about the project:
http://smurfmatic.net/blog/

My portfolio:
http://cedric.sam.name/

I now reside in Hong Kong, where I work on data journalism projects relating to Chinese social media, at the Journalism and Media Studies Centre, University of Hong Kong:
http://jmsc.hku.hk/blogs/ricecooker/

(And I'm a masters student in Interaction Design at the School of Design, HK Polytechnic University! One of our projects: http://vimeo.com/21176300)

E-mail me for professional advice: [email protected]

canada-elections's People

Contributors

cedricsam avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.