Login  Register

Zip codes and Electoral districts

Posted by Stéphane Zagar on Feb 08, 2007; 11:31pm
URL: http://civicaccess.416.s1.nabble.com/Zip-codes-and-Electoral-districts-tp865.html

Hey

In fact, technically it's not complicated to get a zip code mapping with latitude and longitude :

H3T1A1;45.5113;-73.6162
H3T1B1;45.5083;-73.6183
H3T1C1;45.5016;-73.6245
H3T1E1;45.4974;-73.628
H3T1G1;45.51;-73.614
H3T1H1;45.5061;-73.6176
H3T1J1;45.4945;-73.6282
H3T1K1;45.5002;-73.6212
H3T1L1;45.4962;-73.6253
H3T1M1;45.4971;-73.6225
H3T1N1;45.501;-73.6178
H3T1P1;45.4942;-73.6229
H3T1R1;45.5105;- 73.6154
H3T1S1;45.5078;-73.6178
H3T1T1;45.5052;-73.6198
H3T1V1;45.5005;-73.6192
H3T1W1;45.4987;-73.6208
H3T1X1;45.4971;-73.6212
H3T1Y1;45.4959;-73.6206
H3T1Z1;45.4977;-73.6257

And I think it's not that much complicated to do the same reverse engineering for electoral district.

The problem is that mathematically, there are about 17 millions of valid combination of zip code. It take about 1 sec for my script to retrieve the zipcode/lat-long so if we do a basic computation it gives us about... 100 days to retrieve everything (and probably a lot of bandwidth). Even if we set the last number to 1 (what I did in my previous test), it's still about 2 millions valid values. And I'm not sure if the website I use to retrieve this will allow this (with 1 request/sec, I can't imagine they won't see that something is happening).

By the way, I have a question for geostuff people (Tracey ?) : On the geogratis website, there are some files concerning the electoral districts ( http://geogratis.cgdi.gc.ca/geogratis/en/option/select.do?id=1169), but I don't know anything concerning the format (Arc Export or shape file). Is there a way to do something with that ? For example do a process what-ever to find out in which electoral district is a point (long-lat) ?

Steph