Opened 9 years ago

Closed 5 years ago

#2830 closed enhancement (fixed)

Searching by CA (canadian) / GB postcode

Reported by: jwhelan0112@… Owned by: twain
Priority: minor Milestone:
Component: nominatim Version:
Keywords: postcode canada Cc:

Description

For GB postcodes either a search of "en3 6rg,gb" or "en36rg,gb" works fine.

For CA "k4a 1m7,ca" does not work, "k1e3p6,ca" does. Unfortunately k1e3p6 was entered in the wrong format. It should have been "ANA NAN" not "ANANAN" note the space.

Could the search code for GB be copied when searching for Canadian postcodes please. This would make OSM in Canada much more useful. Currently it is not possible to search Canada by postcode.

John

Change History (6)

comment:1 in reply to:  description Changed 9 years ago by twain

Owner: changed from openstreetmap@… to twain
Priority: majorminor
Status: newassigned
Type: defectenhancement

For GB postcodes either a search of "en3 6rg,gb" or "en36rg,gb" works fine.

The current GB version only works through a hideous hack which can't easily be extended because it uses a separate table of postcodes and knowledge of how the uk postcode system works to guess them.

For CA "k4a 1m7,ca" does not work, "k1e3p6,ca" does. Unfortunately k1e3p6 was entered in the wrong format. It should have been "ANA NAN" not "ANANAN" note the space.

I'm currently working on space sensitivity issue for the next version but this is unlikely to be fixed quickly.

--

Brian

comment:2 Changed 9 years ago by jwhelan0112@…

So for the moment if they are entered as ANANAN that should work fine and if ever it is sorted out some one can write a script to rundown the database and split it to the correct format.

Thanks John

comment:3 Changed 9 years ago by jwhelan0112@…

Idle thought time from my time with databases.

Could we have a hidden field for all postcodes that condensed any spaces. Then simply parse out any spaces in the search request and search against this when searching for postcodes.

Thanks

Cheerio John

comment:4 Changed 9 years ago by twain

They will currently work if entered exactly as entered in OSM - so if they are entered as "k4a 1m7" then they will be searchable as "k4a 1m7". I see you have updated the node in OSM - so this would be fixed except Nominatim is not currently being updated due to a database problem.

In general you should enter data correctly in OSM and wait for the tools to be improved.

A condensed index will be added to v2 of the code but due to the size of the data re-indexing is not trivial so it will not be changed instantly.

comment:5 Changed 9 years ago by jwhelan0112@…

"528, Merkley Drive, K4A 1N5,CA" gives the result "528, Merkley Drive, K1E3P6, Ontario, Canada" but does find the correct location. "K1E3P6" is an adjacent post code that was entered incorrectly.

528 is one of the early ones entered and it shows up as "K4A 1N5" in JOSM.

"K4A 1N5,CA" gives no results found as does "578 Merkley Drive, Orleans, K4A 1M7,CA" The post codes are in upper case exactly as Canada Post directs they should be. We don't have issues with Canada Post saying you can't use our postcodes here. I spent a number of years looking into addresses and working with Canada Post on these issues.

A complicating factor would seem to be that although we have imported a large number of roads no city information was added. That is a separate issue that can be addressed. Looking in JOSM everything looks like it is in Ontario but even searches with Ontario bring up nothing.

I realise that Canada is far away from Europe but whilst it is a problem that affects Canadians most I am disappointed that we rate only a minor enhancement for something that doesn't appear to work.

comment:6 Changed 5 years ago by Sarah Hoffmann

Resolution: fixed
Status: assignedclosed

Issue with wrongly displayed postcode has been fixed. Other postcodes work if they have been mapped in OSM and with the known limitation that postcode centroids are currently not updated.

Note: See TracTickets for help on using tickets.