Factsheet
What’s the current postal code range in Canada?
Canada has over 800 000 unique codes; FSAs begin with letters A–Y (not D, F, I, O, Q, U, W, Z).
What is the length of postal codes in Canada?
Each postal code is exactly 6 characters long (3 letters and 3 numbers, with a space in the middle).
How are Canadian postal codes structured?
FSA (first 3): First letter indicates province/territory or major region; second is numeric (1–9 for urban, 0 for rural); third letter narrows locale.
LDU (last 3): Identifies specific delivery unit, such as a city block, a building, or rural route.
Videos
Let’s talk Canadian postal codes
ggmaps and Canadian Postal Codes
I did something similar to this a few months ago using some clinical data.
I can't remember exactly how I did it, but I recall making a separate table with the shape IDs and a column called colour with gradient for 1-whatever based on the number of colours you want.
I merged the shapefile .dbf and the new table, added 0s to the empty values in the colour column then fortified the resulting table.
You can then create a palette with specific colours that match the numbers you gave each polygon group and make 0 = white/grey and it should produce what you want.
This requires a bit of manual work on Excel, so I'm not sure if this is what you'd want to do. Sorry I don't have a very definitive answer !!
More on reddit.comTIL that Canada reserves the postal code "H0H 0H0" for letters addressed to Santa.
Best Postal Code Yet
First, a small vent. I think it’s ridiculous that postal code datasets are proprietary. This should be open data, like every other administrative boundary in the country. Canada Post trying to turn a profit is gross. It straddles a strange line between a crown corporation and a private organization…
Secondly, I’m curious how y’all get your postal code datasets? I work for a small municipality. We currently have a pretty convoluted workflow that takes a land ownership table, cross-references the owner’s full address with the parcel address to extract the postal code to the parcel, remove outliers like owners who don’t live in their house, dissolve the parcel boundaries together where the code matches…There must be a better way?
As I understand it, the postal code lookup website also has functions to block you from simply running a script to scrape their data en masse, so I know that’s not an option…