4

I am developing a web application to collect Canadian postal addresses.

I found some good information on addressing here: http://www.canadapost.ca/tools/pg/manual/PGaddress-e.asp?ecid=murl10006450

However, it doesn't seem to cover all scenarios. For example,

I have also seen references to other types of delivery modes of 'mobile route' or 'suburban service'

I'm lacking knowledge in all the different possibilities for Canadian postal addresses, looking for guidance where I can find comprehensive information. Thanks.

  • What you are describing sounds like what geocoder.ca has done with crowdsourcing. BUT, the Canadian government tried suing them for copyright infringement (Canada Post charges money for the same thing): geocoder.ca/?sued=1 – Andrew - OpenGeoCode Dec 15 '14 at 16:47
  • Thanks, I guess I'm a little overwhelmed at all the possible data elements that can make up a Canadian postal address. I'm still not able to find what a mobile route or suburban service is, for example. It's not explained clearly anywhere i can find. – dave Dec 15 '14 at 20:16
  • suburban service (residential group boxes) and mobile route (industrial complexes) are deliveries contracted out to private mail carriers. This is Canada Post's technical document for presorting mail for delivery: canadapost.ca/cpo/mr/assets/pdf/business/… – Andrew - OpenGeoCode Dec 15 '14 at 21:34
  • Thanks, Canada post addressing guidelines - canadapost.ca/tools/pg/manual/PGaddress-e.asp , don't cover addressing mail to suburban service and mobile route. Maybe its an oversight? I called Canada Post and they said you do need to specify SS or MR when addressing mail if it applies. – dave Dec 16 '14 at 16:09
3

You can use metadata from the Google i18n Internationalization project (link). For example, the address completion metadata from the libaddressinput package (C++ and Java tools) used for Android (Java) and Chromium OS (C++).

The raw data is stored here: https://i18napis.appspot.com/address

For Canada, it looks like this:

    {
   "lang":"en",
   "upper":"ACNOSZ",
   "zipex":"H3Z 2Y7,V8X 3X4,T0L 1K0,T0H 1A0,K1A 0B1",
   "posturl":"http://www.canadapost.ca/cpotools/apps/fpc/personal/findByCity?execution=e2s1",
   "zip":"[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJ-NPRSTV-Z][ ]?\\d[ABCEGHJ-NPRSTV-Z]\\d",
   "fmt":"%N%n%O%n%A%n%C %S %Z",
   "require":"ACSZ",
   "name":"CANADA",
   "languages":"en~fr",
   "sub_keys":"AB~BC~MB~NB~NL~NT~NS~NU~ON~PE~QC~SK~YT",
   "key":"CA",
   "id":"data/CA",
   "sub_names":"Alberta~British Columbia~Manitoba~New Brunswick~Newfoundland and Labrador~Northwest Territories~Nova Scotia~Nunavut~Ontario~Prince Edward Island~Quebec~Saskatchewan~Yukon",
   "sub_zips":"T~V~R~E~A~X0E|X0G|X1A~B~X0A|X0B|X0C~K|L|M|N|P~C~G|H|J|K1A~S|R8A~Y"
}

(link)

And the full list for Canadian addresses:

data/CA
data/CA--fr
data/CA/AB
data/CA/AB--fr
data/CA/BC
data/CA/BC--fr
data/CA/MB
data/CA/MB--fr
data/CA/NB
data/CA/NB--fr
data/CA/NL
data/CA/NL--fr
data/CA/NS
data/CA/NS--fr
data/CA/NT
data/CA/NT--fr
data/CA/NU
data/CA/NU--fr
data/CA/ON
data/CA/ON--fr
data/CA/PE
data/CA/PE--fr
data/CA/QC
data/CA/QC--fr
data/CA/SK
data/CA/SK--fr
data/CA/YT
data/CA/YT--fr 

You then use the individual sub-keys (i.e. QC in french) to download the address formats for that region.

{
   "lang":"fr",
   "name":"Québec",
   "zip":"G|H|J|K1A",
   "key":"QC",
   "id":"data/CA/QC--fr"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.