OK, so I've found plenty of
technical descriptions of the Canadian Postal system, but nothing that answers my question in direct, layman terms. I suspect I understand it correctly, but hopefully some Canucks here can verify for me.
I'm creating a web-service that matches up an individual with their "Local Sales Representative". Currently there are only a couple dozen Sales Representatives for all of Canada, but there is nothing saying that there couldn't be hundreds in the future.
So, a Canadian person goes to the web-form and fills in their Postal Code, and then my program looks up that Postal Code in a database and returns the assigned sales rep. Somebody (not me) gets the thrilling job of maintaining a datafile that maps sales reps to postal codes. What I'm trying to figure out is whether I can prevent making that data-entry person's life horrible.
There are about 850,000 Postal Codes in Canada. However, there are only about 1,800 FSA's (forward sortation area = the first three characters in the postal code). Should it be safe to create the datafile mapping using only the FSA? Assuming I don't expect to be drawing any arbitrary lines right down the middle of the map, thus splitting a town or village in two, I'm thinking the FSA is a reasonable-sized geographic area for dividing up the population...yes?
Posts
Any kind of organization or business with multiple location has a location search function that works with input of a postal code, and there's no way they all wrote their own programming from scratch.
I'd suggest finding out how to get this stuff pre-baked, so you just plug in YOUR company's data.
But to answer your question, try looking at postal code maps. You'll see how large an area the FSA covers geographically.
Even locally (Edmonton) there are 30+ (about haven't counted recently) and when dispatching crews in the city, there are rules for the North ones to use these 7, South use these 9, Floater use these 3 FSA's. It's not perfect because whenever you are on an edge one could be closer than the other but we just kind of ignore that.
For your use, when there is a rep per city or so, that should work great for you (until you start getting 3+ people per city).
There are, but you'd be surprised how expensive some of that stuff is. Though with what I deal with, we need a 24x7 always up type solution so there might be some free alternatives out there more for you.
so you should be just fine mapping the fsa's to sales reps unless your dealing with a lot of rural areas. for rural/small towns you need the whole postal code to tell where the place is beyond a province.
edit: wikipedia has nice lists of the postal codes and links to the canada post maps of the fsa's.:
http://en.wikipedia.org/wiki/List_of_A_postal_codes_of_Canada
They have a tool that lets you type in a postal code and gives you the address. I believe google maps also lets you search by postal code and can return an address so that is also an option if you can somehow get your program to output the postal code to the website and then accept the address it returns.
It's generally a bad idea to simply submit information to an external webpage and then parse out what you want from what the website returns. Building an application to depend on a website out of your control is asking for trouble, because it means your application will break if the website you depend on changes.
Instead what he wants is an API, or application programming interface. APIs allow you to use certain functionality of a website in a better way than what I described above - by making requests to the API, a programmer receives the data they want.
Ramius, in this case you should look into the family of Google Maps APIs, specifically the Geocoding API. Note that this is restricted to 2,500 requests per day, unless you pay for a premier account. Also, you must display the data using Google Maps. If this is too restrictive, look into geocoder.ca. I'm sure there are more similar APIs available.
Such an API will allow you to convert a postal code to a format that is easier to map to a representative.