Select to view content in your preferred language

Is it possible to get Canadian postal codes via ArcGIS Geocode?

5684
7
12-20-2016 08:54 AM
MS
by
Occasional Contributor

Hi

When using the AGOL map (or the rest api) to search for an address in Canada, it only ever gives back the first three characters of a postal code, never the entire six character string.  Is this data available?  Since the online geocoder gets a lot of its information from HERE I tried their online examples, and was able to pull back the entire six character postal code, so I'm not sure if I'm doing something wrong w/ agol.

Thanks.

0 Kudos
7 Replies
BruceHarold
Esri Regular Contributor

In a REST call supply outFields=* and PostalExt will be returned.

MS
by
Occasional Contributor

Hi Bruce, thank you for your reply.

I have been using outfields=*, here's an example of a url I've tried - you'll notice in the results that the postalext field is blank.

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?&f=json&Sin... 

Thanks.

0 Kudos
BruceHarold
Esri Regular Contributor

OK, I can see a failure too, it may be data dependent, please log a support call.

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?&f=pjson&Si... 

Regards

0 Kudos
MS
by
Occasional Contributor

After talking esri support, confirmed bug: http://support.esri.com/bugs/nimbus/role/distributor/QlVHLTAwMDA4NjQ1NA==

Considering how long it's been outstanding, I'm not holding out any hope that it'll be fixed - unfortunate that we'll have to look elsewhere for a solution.

AlanRex1
Esri Contributor

Hi M S,

 

I just spoke with the US support analyst who was working with the Canadian support analyst you were working with.  You should be getting this information via your case but I wanted to respond here for other users who may view this thread.

 

The bug that you were attached to is not actually relevant to your particular use case.  That bug is specific to geocoding ONLY the postal codes in Canada (not a full street address), and then only when zoomed in beyond a specific extent.   

 

First a quick note about Canadian Addresses.  Like US addresses, they are technically split into two sections.  In the US we call the two parts Zip+4 (12345+6789).  In Canada they're called Forward Sortation Area (first three digits, A1A) + Local Delivery Unit (second three digits, 1A1).  In the Esri datasets, we have two fields; one called Postal (which for the US is the 5 digit zip code and for Canada is the FSA) and one called PostalExt (which for the US is the zip+4 and for Canada is FSA+LDU).  

Regarding BUG-000086454, when a user is zoomed into certain extent in the Map Viewer the request that's sent to the World Geocoding Service includes location and distance parameters, so if there are two similar addresses returned by your request the Map Viewer will zoom to the one that's closer to where you're currently looking in your map.  If you geocoded M3C 3R8, you might be closer to the centroid of M3C than you are to the centroid of M3C 3R8, and therefore the Map Viewer will return M3C instead of the "full" postal code.  That's the very basic underlying issue behind BUG-000086454 but that's not what you're running into.

 

You're geocoding an entire street address ("1000 Bay St, Toronto, Ontario, CAN").  When you're geocoding to the street or house level you'll be getting responses from our point address or street address locators (not the postal or postal+ext locators like the workflow from BUG-000086454).  By default, these locators will return only the Postal field I mentioned above, not the PostalExt field. 

 

Since the Postal field only includes the first 3 characters of the full Canadian postal code, this means what you're seeing is expected behavior.  However, from a practical standpoint it's definitely more common to use the full 6 character Canadian postal code than the 9 digit US zip code, so I can definitely see room for improvement here.  Therefore, I've asked the analysts you've been working with to log an enhancement request to deal with this specific Canadian use case.  They should be providing you with the ENH code when it's been fully written up.  

I hope this helps clarify the behavior you're seeing.  Thank you for calling attention to this issue!

MS
by
Occasional Contributor

Thank you for your reply Alan.

0 Kudos
GlennLetham2
Frequent Contributor

awesome explanation! CN postal codes have been a pain to deal with forever! Even worse, getting any access to "open" postal code areas is nearly impossible as well. People still wrangle with the same issues they were having twenty years ago, its quite amazing really... sigh

0 Kudos