Login  Register

Re: elections canada

Posted by Russell McOrmond-2 on Feb 03, 2007; 4:27pm
URL: http://civicaccess.416.s1.nabble.com/elections-canada-tp814p845.html

Daniel Haran wrote:
> Second, I tried to replace the postal code parameter in the URL, but
> no dice. Non-geek translation: they make it difficult to check
> different postal codes. Since no list that I know is public domain,
> you'd have to more or less try each one to find the 500,000+ that are
> valid. Could take a while.

   There have been various screen scraping techniques over the years,
aimed either at
http://www.parl.gc.ca/information/about/people/house/PostalCode.asp?Language=E&source=sm 
or http://www.elections.ca/scripts/pss/FindED.aspx


   With parl.gc.ca you need to have a second database that matches their
"magic numbers" for what they are using for ridings to electoral
district ID's.  This is easy enough to build, but changes each time the
MP changes.

   The elections Canada site does use EDID's, but is also deliberately
trying to make it extremely hard to screen scrape.  They also randomly
change the site from time to time to kill off older tools.


   The Lobby module for Drupal has a screen scraper in it, but because
of changes on government sites it would need to be tweaked to work.  It
uses the
"http://www.parl.gc.ca/information/about/people/house/PostalCode.asp?Language=E&txtPostalCode="
script, which doesn't often work during elections.
http://drupal.org/project/lobby


   Because the US doesn't have crown copyright, this type of data is in
the public domain and can be included in core modules of CMS's such as
http://drupal.org/project/location



   I get a question about what we are doing on the digital-copyright.ca
site every once in a while, and my most recent answer is at
http://www.digital-copyright.ca/discuss/6575

   Shortform: I'm using a database purchased (by a customer of mine)
from Statistics Canada.  I even set up a meeting with them, and they
weren't interested in trying to have this information released.  I've
written letters to MPs, but received no reply.

http://www.digital-copyright.ca/search/node/PCFRF

   This is a very tiny database that would be very appropriate to have
released, but it requires some political will.  Statistics Canada folks
told me that Elections Canada is not a customer of their product,
meaning Elections is duplicating effort because of this nonsense "cost
recovery" scheme.   Both are based on information they have to purchase
from Canada Post which links postal codes to geography, and then match
that to electoral districts.

   When doing screen scraping or using the database it is important to
realize this is not a one-to-one mapping.   A postal code can match
anywhere from 0 to 6 different electoral districts given overlap.
Details are at http://www.digital-copyright.ca/node/1607

--
  Russell McOrmond, Internet Consultant: <http://www.flora.ca/>
  Please help us tell the Canadian Parliament to protect our property
  rights as owners of Information Technology. Sign the petition!
  http://www.digital-copyright.ca/petition/ict/

  "The government, lobbied by legacy copyright holders and hardware
   manufacturers, can pry my camcorder, computer, home theatre, or
   portable media player from my cold dead hands!"